public final class LoggingUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isLoggable(Level level,
Level threshold)
Verifies if the given level is above the required threshold for logging.
|
static boolean |
isLoggable(org.slf4j.Logger logger,
Level level) |
static void |
logMessage(org.slf4j.Logger logger,
Level level,
Object message,
Throwable t) |
static SimplifiedLog |
wrap(org.slf4j.Logger logger) |
public static boolean isLoggable(Level level, Level threshold)
level - The Level to evaluatethreshold - The threshold Leveltrue if the evaluated level is above the required
threshold.
Note(s):
If either argument is null then result is false.
If the evaluated level is Level.OFF then result is false
regardless of the threshold.
If the threshold is Level.ALL and the evaluated level is
not Level.OFF the result is true.
Otherwise, the evaluated level Level.intValue() must be
greater or equal to the threshold.
public static SimplifiedLog wrap(org.slf4j.Logger logger)
public static void logMessage(org.slf4j.Logger logger,
Level level,
Object message,
Throwable t)
public static boolean isLoggable(org.slf4j.Logger logger,
Level level)
logger - The Logger instance - ignored if nulllevel - The validate log Level - ignored if nulltrue if the level is enabled for the logger. The
mapping of the level to the logger is as follows:
Level.OFF always returns falseLevel.SEVERE returns Logger.isErrorEnabled()Level.WARNING returns Logger.isWarnEnabled()Level.INFO and Level.ALL returns Logger.isInfoEnabled()Level.CONFIG and Level.FINE returns Logger.isDebugEnabled()Logger.isTraceEnabled()Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.