判断日志级别

@param logger Logger
@param l      Level

@return boolean
2166
public boolean isLoggable(Logger logger, Level l) {
        return logger.isLoggable(l) && l.intValue() >= this.logLevel;
    }
1325047
public void log(String message, Level level) {
    log(null, null, message, level);
  }
1286627
public boolean setLevel(String level) {
        boolean isSucceed = true;
        try {
            LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
            loggerContext.getLogger("root").setLevel(Level.valueOf(level));
        } catch (Exception e) {
            e.printStackTrace();
            isSucceed = false;
        }
        return isSucceed;
    }
134594
@Override
    public void emit(Level level, String message, long sequence, Logger logger) {
        emit(level, message, sequence);
        logger.log(level, message);
    }
937805
public static function isLog($log_level)
    {
        if (self::$log_mode === null) {
            $log_mode_config = Config::getEnv("app.log_mode");
            if ($log_mode_config < 0 || $log_mode_config > 8) {
                throw new \InvalidArgumentException("日志模式必须是0到8之间的整数，请检查配置项:app.log_mode");
            }
            self::$log_mode = $log_mode_config;
        }

        if (self::$log_mode <= array_search($log_level, self::$log_level_allow)) {
            return true;
        }

        return false;
    }
1132746
def logger
      l = ::Logger.new($stderr)

      case mode
      when :debug
        l.level = ::Logger::DEBUG
        format_debug(l)
      when :silent
        l.level = 9_999
      when :info
        l.level = ::Logger::INFO
        format_standard(l)
      else
        l.level = ::Logger::INFO
        format_standard(l)
      end

      l
    end
978655
public static void log (@Nonnull final Logger aLogger,
                          @Nonnull final IHasErrorLevel aErrorLevelProvider,
                          @Nonnull final String sMsg)
  {
    log (aLogger, aErrorLevelProvider.getErrorLevel (), sMsg, null);
  }
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;
    }
417327
public function logger($logger = null)
    {
        if ($logger) {
            $this->_logger = $logger;
        }

        if ($this->_logger) {
            return $this->_logger;
        }

        $this->_logger = new QueryLogger();
        return $this->_logger;
    }
1035442
private static void writeToLog(Logger logger, Level level, String pattern, Exception exception) {
    if (level == Level.ERROR) {
      logger.error(pattern, exception);
    } else if (level == Level.INFO) {
      logger.info(pattern);
    } else if (level == Level.DEBUG) {
      logger.debug(pattern);
    }
  }
184150
@Nullable
    public String getLoggerLevel(@Nullable String loggerName) {
        try {
            loggerName = loggerName == null ? "" : loggerName;
            if (loggerName.isEmpty()) {
                return LogManager.getRootLogger().getLevel().toString();
            }

            Logger logger = LogManager.exists(loggerName);
            if (logger == null) {
                return null;
            } else {
                Level level = logger.getLevel();
                if (level == null) {
                    return null;
                }
                return level.toString();
            }
        } catch (RuntimeException e) {
            logger.warn("Exception getting effective logger level " + loggerName, e);
            throw e;
        }
    }
171622
public static void logException( Logger logger, Throwable t ) {
		logException( logger, Level.FINEST, t );
	}
1041301
public static <T> Parameters.Builder<T> logger(Logger logger) {
        return Parameters.<T> builder().logger(logger);
    }
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;
    }    
}
1087110
def log(self, msg, lvl = 0):
        ''''''
        if self.log_level >= lvl:
            self.log_fn(msg)
1128251
public void setLogger(Logger logger) {
		this.logger = logger == null ? LoggerFactory.getLogger(getClass()) : logger;
	}
400785
def logger(logger, level = :info, format = :apache)
      default_options[:logger]     = logger
      default_options[:log_level]  = level
      default_options[:log_format] = format
    end