Given to log4j logging level, converts it to TANGO level
484614
public int log4j_to_tango_level(Level level)
  {
   if (level.equals(Level.OFF)) {
     return LOGGING_OFF;
   }
   if (level.equals(Level.FATAL)) {
     return LOGGING_FATAL;
   }
   if (level.equals(Level.ERROR)) {
     return LOGGING_ERROR;
   }
   if (level.equals(Level.WARN)) {
     return LOGGING_WARN;
   }
   if (level.equals(Level.INFO)) {
       return LOGGING_INFO;
   }
      return LOGGING_DEBUG;
  }
457720
private void log(Level level, String content, Throwable throwable) {
        String dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date());
        String log = String.format("[%s] %s [] - %s", level, dateStr, content);
        if(level.isLessSpecificThan(Level.ERROR)
                && level.isMoreSpecificThan(Level.OFF)) {
            System.err.println(log);
        } else {
            System.out.println(log);
        }

        if (throwable != null) {
            throwable.printStackTrace(System.err);
        }
    }
654405
def set_log_level(debug, verbose):
    
    if debug:
        logging.basicConfig(level=logging.DEBUG)
    elif verbose:
        logging.basicConfig(level=logging.INFO)
1310355
@VisibleForTesting
  static Level getLogLevel(Throwable t) {
    if (t instanceof IOException && t.getMessage() != null) {
      for (String msg : QUIET_ERRORS) {
        if (t.getMessage().equals(msg)) {
          return Level.FINE;
        }
      }
    }
    return Level.INFO;
  }
419676
function getLogLevel(level, action, payload, type) {
  switch (typeof level === 'undefined' ? 'undefined' : _typeof(level)) {
    case 'object':
      return typeof level[type] === 'function' ? level[type].apply(level, _toConsumableArray(payload)) : level[type];
    case 'function':
      return level(action);
    default:
      return level;
  }
}
17138
public void setLoggingLevel(final int loggingLevel, final Class<?>... deviceClassNames) {

        if (rootLoggingLevel < loggingLevel) {
            setRootLoggingLevel(loggingLevel);
        }
        System.out.println("set logging to " + LoggingLevel.getLevelFromInt(loggingLevel));
        final Logger tangoLogger = LoggerFactory.getLogger("org.tango.server");
        if (tangoLogger instanceof ch.qos.logback.classic.Logger) {
            final ch.qos.logback.classic.Logger logbackLogger = (ch.qos.logback.classic.Logger) tangoLogger;
            logbackLogger.setLevel(LoggingLevel.getLevelFromInt(loggingLevel));
        }
        final Logger blackboxLogger = LoggerFactory.getLogger(Constants.CLIENT_REQUESTS_LOGGER);
        if (blackboxLogger instanceof ch.qos.logback.classic.Logger) {
            final ch.qos.logback.classic.Logger logbackLogger = (ch.qos.logback.classic.Logger) blackboxLogger;
            logbackLogger.setLevel(LoggingLevel.getLevelFromInt(loggingLevel));
        }
        for (int i = 0; i < deviceClassNames.length; i++) {
            final Logger deviceLogger = LoggerFactory.getLogger(deviceClassNames[i]);
            if (deviceLogger instanceof ch.qos.logback.classic.Logger) {
                final ch.qos.logback.classic.Logger logbackLogger = (ch.qos.logback.classic.Logger) deviceLogger;
                logbackLogger.setLevel(LoggingLevel.getLevelFromInt(loggingLevel));
            }
        }

    }
699556
public void log(Level level, Throwable throwable, String msg, Object[] argArray) {
		logIfEnabled(level, throwable, msg, UNKNOWN_ARG, UNKNOWN_ARG, UNKNOWN_ARG, argArray);
	}
165550
private static int logger(int level, String message, Throwable throwable) {

        if (QuickUtils.shouldShowLogs()) {
            switch (level) {

                case QuickUtils.DEBUG:
                    return android.util.Log.d(QuickUtils.TAG, message, throwable);
                case QuickUtils.VERBOSE:
                    return android.util.Log.v(QuickUtils.TAG, message, throwable);
                case QuickUtils.INFO:
                    return android.util.Log.i(QuickUtils.TAG, message, throwable);
                case QuickUtils.WARN:
                    return android.util.Log.w(QuickUtils.TAG, message, throwable);
                case QuickUtils.ERROR:
                    return android.util.Log.e(QuickUtils.TAG, message, throwable);
                default:
                    break;
            }
        }

        return -1;
    }
397039
public static <C> JULLogTemplate<C> toJUL(String loggerName, Level level) {
		return new JULLogTemplate<>(loggerName, level);
	}
1286759
def py_log_level(self, default='none'):
        ''' 

        '''
        level = self._get_str("PY_LOG_LEVEL", default, "debug")
        LEVELS = {'trace': logging.TRACE,
                  'debug': logging.DEBUG,
                  'info' : logging.INFO,
                  'warn' : logging.WARNING,
                  'error': logging.ERROR,
                  'fatal': logging.CRITICAL,
                  'none' : None}
        return LEVELS[level]
567637
def log_level=(level)
      log_level = java.util.logging.Level.const_get(level.to_s.upcase)

      [ 'com.gargoylesoftware.htmlunit',
        'com.gargoylesoftware.htmlunit.html',
        'com.gargoylesoftware.htmlunit.javascript',
        'org.apache.commons.httpclient'
      ].each { |package| Celerity::Util.logger_for(package).level = log_level }

      level
    end
399973
def init_logging(log_level):
    
    log_level = log_level_to_string_map[min(log_level, 5)]

    msg = "%(levelname)s - %(name)s:%(lineno)s - %(message)s" if log_level in os.environ else "%(levelname)s - %(message)s"

    logging_conf = {
        "version": 1,
        "root": {
            "level": log_level,
            "handlers": ["console"]
        },
        "handlers": {
            "console": {
                "class": "logging.StreamHandler",
                "level": log_level,
                "formatter": "simple",
                "stream": "ext://sys.stdout"
            }
        },
        "formatters": {
            "simple": {
                "format": " {0}".format(msg)
            }
        }
    }

    logging.config.dictConfig(logging_conf)
972516
public static <C> SLF4JLogTemplate<C> toSLF4J(String loggerName, String levelName, String markerName) {
		if ("debug".equalsIgnoreCase(levelName)) {
			return new SLF4JLogTemplate.Debug<>(loggerName, markerName);
		} else if ("info".equalsIgnoreCase(levelName)) {
			return new SLF4JLogTemplate.Info<>(loggerName, markerName);
		} else if ("warn".equalsIgnoreCase(levelName)) {
			return new SLF4JLogTemplate.Warn<>(loggerName, markerName);
		} else {
			throw new IllegalArgumentException("Invalid level name " + levelName);
		}
	}
811753
def log_to_json(log):
    """"""
    return [log.timestamp.isoformat()[:22],
            log.level, log.process, log.message]
833987
@SuppressWarnings("deprecation")
    public VoltTable[] run(SystemProcedureExecutionContext ctx,
                           String username,
                           String remoteHost,
                           String xmlConfig)
    {
        long oldLevels  = 0;
        if (ctx.isLowestSiteId()) {
            // Logger level is a global property, pick the site with lowest id to do it.
            hostLog.info(String.format("%s from %s changed the log4j settings", username, remoteHost));
            hostLog.info(xmlConfig);
            oldLevels = hostLog.getLogLevels(loggers);
        }

        try {
            // Mimic the multi-fragment semantics as scatter-gather pattern is an overkill for this simple task.
            // There are chances that some sites being interrupted and update the logging before old logger level
            // being read, but the reasons we don't care because 1) it is rare and 2) it only effects when HOST
            // logger being changed from higher than INFO level to INFO or lower level.
            barrier.await();
        } catch (InterruptedException | BrokenBarrierException dontcare) { }

        VoltDB.instance().logUpdate(xmlConfig, DeprecatedProcedureAPIAccess.getVoltPrivateRealTransactionId(this),
                ctx.getPaths().getVoltDBRoot());
        ctx.updateBackendLogLevels();

        if (ctx.isLowestSiteId()) {
            long newLevels = hostLog.getLogLevels(loggers);
            if (newLevels != oldLevels) {
                // If HOST logger wasn't able to log before and now it can, logs the setting change event.
                int index = (int)((oldLevels >> 3) & 7);
                Level before = Level.values()[index];
                index = (int)((newLevels >> 3) & 7);
                Level after = Level.values()[index];
                if (before.ordinal() > Level.INFO.ordinal() && after.ordinal() <= Level.INFO.ordinal()) {
                    hostLog.info(String.format("%s from %s changed the log4j settings", username, remoteHost));
                    hostLog.info(xmlConfig);
                }
            }
            barrier.reset();
        }

        VoltTable t = new VoltTable(VoltSystemProcedure.STATUS_SCHEMA);
        t.addRow(VoltSystemProcedure.STATUS_OK);
        return (new VoltTable[] {t});
    }
856948
public static void setLogLevel(String cls, String level){
        Logger l = null;
        if(Objects.isNullOrEmpty(cls))
            l = LogManager.getRootLogger();
        else
            l = LogManager.getLogger(cls);
        if(level.equalsIgnoreCase("TRACE"))
            l.setLevel(Level.TRACE);
        else if(level.equalsIgnoreCase("DEBUG"))
            l.setLevel(Level.DEBUG);
        else if(level.equalsIgnoreCase("INFO"))
            l.setLevel(Level.INFO);
        else if(level.equalsIgnoreCase("WARN"))
            l.setLevel(Level.WARN);
        else if(level.equalsIgnoreCase("ERROR"))
            l.setLevel(Level.ERROR);
    }
397641
@Override
    protected void logImpl(LogLevel level,Object[] message,Throwable throwable)
    {
        //get log level
        int levelValue=level.getValue();
        Level jdkLevel=null;
        switch(levelValue)
        {
            case LogLevel.DEBUG_LOG_LEVEL_VALUE:
                jdkLevel=Level.FINEST;
                break;
            case LogLevel.ERROR_LOG_LEVEL_VALUE:
                jdkLevel=Level.SEVERE;
                break;
            case LogLevel.INFO_LOG_LEVEL_VALUE:
            default:
                jdkLevel=Level.FINE;
                break;
        }

        if(jdkLevel!=null)
        {
            //format log message (without exception)
            String text=this.formatLogMessage(level,message,null);

            //log
            this.JDK_LOGGER.log(jdkLevel,text,throwable);
        }
    }