LogLevelis used to indicate a severity level for selecting which logging messages to report.
The static singleton comparator
COMPARATOR may be used
to compare severity levels.
Unlike other commonly used logging packages (e.g. Java Logging, Log4J, Jakarta Commons Logging), this logging package is completely configuration free in the sense that it is configured entirely through the API.
Each logging level has an integer severity level. A
Reporter will report messages that are at or above its specified
The logging levels in increasing order of severity are:
TRACE: Verbose debugging.
DEBUG: Fine-grained debugging.
INFO: Coarse-grained application flow.
WARN: Potentially harmful situation.
ERROR: Potentially recoverable error.
FATAL: Unrecoverable error.
There are also two special levels which bound the regular severity levels.
ALL: Report all log messages. Highest possible severity.
NONE: Report no log messages. Lowest possible severity.
The levels were chosen to follow the most popular loggers for Java:
|Enum Constant and Description|
Special level with lowest possible severity.
Error that may be recoverable.
Coarse-grained application flow information.
Special severity with level higher than all other levels.
Very detailed debugging information.
Possibly harmful situation .
|Modifier and Type||Field and Description|
Returns a comparator that compares levels by severity.
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final LogLevel ALL
public static final LogLevel TRACE
public static final LogLevel DEBUG
public static final LogLevel INFO
public static final LogLevel WARN
public static final LogLevel ERROR
public static final LogLevel FATAL
public static final LogLevel NONE
public static final Comparator<LogLevel> COMPARATOR
level1is more severe than
level1is less severe than
level2, it returns
-1, and if they are equally severe, it returns
public static LogLevel values()
for (LogLevel c : LogLevel.values()) System.out.println(c);