判断日志级别

@param logger Logger
@param l      Level
@param str    String

@return boolean
549921
public boolean isLoggable(Logger logger, Level l, String str) {
        boolean rs = logger.isLoggable(l) && l.intValue() >= this.logLevel;
        if (this.excludeLogLevels == null || !rs || str == null) return rs;
        String[] keys = this.excludeLogLevels.get(l.intValue());
        if (keys == null) return rs;
        for (String key : keys) {
            if (str.contains(key)) return false;
        }
        return rs;
    }
524269
def log_level(level_string):
	
	if level_string.isdigit():
		return int(level_string)
	return getattr(logging, level_string.upper())
85383
public void log(Level level, String format, Object... args)
    {
        if (isLoggable(level))
        {
            if (format != null)
            {
                logIt(level, String.format(format, args));
            }
            else
            {
                logIt(level, String.format("%s format == null", level));
            }
        }
    }
954437
def set_log_level(logger_name: str, log_level: str, propagate: bool = False):
    """"""
    log = logging.getLogger(logger_name)
    log.propagate = propagate
    log.setLevel(log_level)
628549
public static void info(String str) {
    	switch (ZAP.getProcessType()) {
    	case cmdline:	System.out.println(str); break;
    	default:		// Ignore
    	}
    	// Always write to the log
    	logger.info(str);
    }
1315837
def loggerLevel(self, logger='root'):
        
        if isinstance(logger, logging.Logger):
            logger = logger.name
        
        return self.handler().loggerLevel(logger)
340976
def _has_streamhandler(logger, level=None, fmt=LOG_FORMAT,
                       stream=DEFAULT_STREAM):
    
    # Ensure we are talking the same type of logging levels
    # if they passed in a string we need to convert it to a number
    if isinstance(level, basestring):
        level = logging.getLevelName(level)

    for handler in logger.handlers:
        if not isinstance(handler, logging.StreamHandler):
            continue
        if handler.stream is not stream:
            continue
        if handler.level != level:
            continue
        if not handler.formatter or handler.formatter._fmt != fmt:
            continue
        return True
    return False
171622
public static void logException( Logger logger, Throwable t ) {
		logException( logger, Level.FINEST, t );
	}
341300
public void log(java.util.logging.Level level, CharSequence message) {
    LogRecord rec = new ELKILogRecord(level, message);
    logger.log(rec);
  }
745504
public void log(Logger targetLogger)
    {
        Object[] argumentArray = getArgumentArray();
        if (getArgumentArray() == null) {
            log(targetLogger, getLevel(), getMarker(), getMessage(), getThrowable());
        } else {
            if (getThrowable() != null) {
                argumentArray = ArrayUtils.add(getArgumentArray(), getThrowable());
            }

            log(targetLogger, getLevel(), getMarker(), getMessage(), argumentArray);
        }
    }
1374689
function Logger(level) {
    if (_.isString(level) && _.has(LogLevel, level)) {
        this.level = LogLevel[level];    
    } else if (_.isNumber(level) && level >= 0 && level <= 4) {
        this.level = level;
    } else {
        this.level = LogLevel.info;
    }    
}
211734
public void setLogger(String logger)
    {
        if(logger != null && logger.trim().length() > 0)
            this.logger = LoggerFactory.getLogger(logger);
    }
208684
public void i(String msg, Throwable tr) {
    println(LogLevel.INFO, msg, tr);
  }
970273
def set_log_level(logger, level):  # type: (logging.Logger, int) -> None
    """"""
    if level > 2:
        level = 2
    if level < -1:
        level = -1

    levels = {
        -1: logging.ERROR,
        0: logging.WARN,
        1: logging.INFO,
        2: logging.DEBUG
    }
    logger.setLevel(levels[level])
733222
def addLogger(self, logger, level=logging.INFO):
        
        if isinstance(logger, logging.Logger):
            logger = logger.name
        
        if logger in self._loggers:
            return
        
        # allow the handler to determine the level for this logger
        if logger == 'root':
            _log = logging.getLogger()
        else:
            _log = logging.getLogger(logger)
        
        _log.addHandler(self.handler())
        
        self._loggers.add(logger)
        self.handler().setLoggerLevel(logger, level)
413820
public static synchronized boolean addLogger(@NonNull JobLogger logger) {
        for (JobLogger printer1 : loggers) {
            if (logger.equals(printer1)) {
                return false;
            }
        }

        for (int i = 0; i < loggers.length; i++) {
            if (loggers[i] == null) {
                loggers[i] = logger;
                return true;
            }
        }

        int index = loggers.length;
        loggers = Arrays.copyOf(loggers, loggers.length + 2);
        loggers[index] = logger;
        return true;
    }
1130013
public static void log(Logger logger,
                           Level level,
                           String message,
                           Object parameter) {
        log(logger, level, message, new Object[] { parameter });
    }