public final class Level extends Object
Level
class defines a set of standard logging levels that can be used to control logging output.
Enabling logging at a given level also enables logging at all higher levels.
The levels in descending order are:
This class cannot be instantiated or subclassed by clients.
Logger.setLevel(Level)
Modifier and Type | Field and Description |
---|---|
static Level |
DEBUG
DEBUG level is used to assist in debugging problems that may be associated with
particular configurations. |
static Level |
ERROR
ERROR level should describe events that are of considerable importance and which will prevent normal program execution. |
static Level |
INFO
INFO level should only be used for reasonably significant messages that
will make sense to end users and system admins. |
static Level |
WARNING
WARNING level should describe events that will be of interest to end users or system managers,
or which indicate potential problems. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Level level)
Compares this level with the specified level for order.
|
boolean |
isDebug()
Returns
true if this level is DEBUG . |
boolean |
isError()
Returns
true if this level is ERROR . |
boolean |
isInfo()
Returns
true if this level is INFO . |
boolean |
isWarning()
Returns
true if this level is WARNING . |
String |
toString()
Returns a
String representation of this level. |
public static final Level DEBUG
DEBUG
level is used to assist in debugging problems that may be associated with
particular configurations.public static final Level INFO
INFO
level should only be used for reasonably significant messages that
will make sense to end users and system admins.public static final Level WARNING
WARNING
level should describe events that will be of interest to end users or system managers,
or which indicate potential problems.public static final Level ERROR
ERROR
level should describe events that are of considerable importance and which will prevent normal program execution.public int compareTo(Level level)
Compares this level with the specified level for order. Returns a negative integer, zero, or a positive integer as this level is less than, equal to, or greater than the specified level.
The lowest level is DEBUG
, the highest is ERROR
level
- the level to compare with.public boolean isDebug()
true
if this level is DEBUG
.true
if this level is DEBUG
, false
otherwise.public boolean isInfo()
true
if this level is INFO
.true
if this level is INFO
, false
otherwise.public boolean isWarning()
true
if this level is WARNING
.true
if this level is WARNING
, false
otherwise.public boolean isError()
true
if this level is ERROR
.true
if this level is ERROR
, false
otherwise.