public enum LogLevel extends Enum<LogLevel>
LogLevel is 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
level.
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:
java.util.logging.Levelorg.apache.log4j.Levelorg.apache.commons.logging.Logorg.apache.avalon.framework.logger.LogKitLogger
| Enum Constant and Description |
|---|
ALL
Special level with lowest possible severity.
|
DEBUG
Fine-grained debugging.
|
ERROR
Error that may be recoverable.
|
FATAL
Unrecoverable error.
|
INFO
Coarse-grained application flow information.
|
NONE
Special severity with level higher than all other levels.
|
TRACE
Very detailed debugging information.
|
WARN
Possibly harmful situation .
|
| Modifier and Type | Field and Description |
|---|---|
static Comparator<LogLevel> |
COMPARATOR
Returns a comparator that compares levels by severity.
|
| Modifier and Type | Method and Description |
|---|---|
static LogLevel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LogLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
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
level1 is more severe than level2, LogLevel.COMPARATOR.compare(level1,level2) returns 1,
if level1 is less severe than level2, it
returns -1, and if they are equally severe, it returns
0.public static LogLevel[] values()
for (LogLevel c : LogLevel.values()) System.out.println(c);
public static LogLevel valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2016 Alias-i, Inc.. All rights reserved.