Here you can find the source of isLoggable(final Logger logger, final Level level)
Parameter | Description |
---|---|
logger | the logger to be checked |
level | the log- Level to be checked |
public static boolean isLoggable(final Logger logger, final Level level)
//package com.java2s; //License from project: Open Source License import java.util.logging.Level; import org.slf4j.Logger; public class Main { /**//from www . ja v a 2 s .c o m * Is the desired LogLevel active? * * @param logger the logger to be checked * @param level the log-{@link Level} to be checked * @return true if it is logable */ public static boolean isLoggable(final Logger logger, final Level level) { if (level == Level.INFO) { return logger.isInfoEnabled(); } else if (level == Level.SEVERE) { return logger.isErrorEnabled(); } else if (level == Level.WARNING) { return logger.isWarnEnabled(); } else if (level == Level.FINE || level == Level.FINER || level == Level.FINEST) { return logger.isDebugEnabled(); } return false; } }