java.util.logging
public class Level extends Object implements Serializable
java.util.logging.Level.INFO
),
and applications should utilize those whenever possible. For specialized
purposes, however, applications can sub-class Level in order to define
custom logging levels.
Field Summary | |
---|---|
static Level | ALL
The ALL level is used as a threshold for filtering
log records, meaning that every message should be logged.
|
static Level | CONFIG
Log records whose level is CONFIG are used for
describing the static configuration, for example the windowing
environment, the operating system version, etc. |
static Level | FINE
Log records whose level is FINE are typically used
for messages that are relevant for developers using
the component generating log messages. |
static Level | FINER
Log records whose level is FINER are intended for
rather detailed tracing, for example entering a method, returning
from a method, or throwing an exception. |
static Level | FINEST
Log records whose level is FINEST are used for
highly detailed tracing, for example to indicate that a certain
point inside the body of a method has been reached. |
static Level | INFO
Log records whose level is INFO are used in purely
informational situations that do not constitute serious errors or
potential problems. |
static Level | OFF
The OFF level is used as a threshold for filtering
log records, meaning that no message should be logged.
|
static Level | SEVERE
Log records whose level is SEVERE indicate a serious
failure that prevents normal program execution. |
static Level | WARNING
Log records whose level is WARNING indicate a
potential problem that does not prevent normal program execution.
|
Constructor Summary | |
---|---|
protected | Level(String name, int value)
Creates a logging level given a name and an integer value.
|
protected | Level(String name, int value, String resourceBundleName)
Create a logging level given a name, an integer value and a name
of a resource bundle for localizing the level name. |
Method Summary | |
---|---|
boolean | equals(Object other)
Checks whether this Level's integer value is equal to that of
another object.
|
String | getLocalizedName()
Returns the name of the Level after localizing it, for example
"WARNUNG". |
String | getName()
Returns the name of the Level without localizing it, for example
"WARNING". |
String | getResourceBundleName()
Returns the name of the resource bundle used for localizing the
level name.
|
int | hashCode()
Returns a hash code for this Level which is based on its numeric
value. |
int | intValue()
Returns the integer value of the Level. |
static Level | parse(String name)
Returns one of the standard Levels given either its name or its
integer value. |
String | toString()
Returns the name of the Level without localizing it, for example
"WARNING". |
ALL
level is used as a threshold for filtering
log records, meaning that every message should be logged.
See Also: setLevel
CONFIG
are used for
describing the static configuration, for example the windowing
environment, the operating system version, etc.FINE
are typically used
for messages that are relevant for developers using
the component generating log messages. Examples include minor,
recoverable failures, or possible inefficiencies.FINER
are intended for
rather detailed tracing, for example entering a method, returning
from a method, or throwing an exception.FINEST
are used for
highly detailed tracing, for example to indicate that a certain
point inside the body of a method has been reached.INFO
are used in purely
informational situations that do not constitute serious errors or
potential problems. In the default logging configuration, INFO
messages will be written to the system console. For this reason,
the INFO level should be used only for messages that are
important to end users and system administrators. Messages at
this level should be understandable to an inexperienced,
non-technical user.OFF
level is used as a threshold for filtering
log records, meaning that no message should be logged.
See Also: setLevel
SEVERE
indicate a serious
failure that prevents normal program execution. Messages at this
level should be understandable to an inexperienced, non-technical
end user. Ideally, they explain in simple words what actions the
user can take in order to resolve the problem.WARNING
indicate a
potential problem that does not prevent normal program execution.
Messages at this level should be understandable to an
inexperienced, non-technical end user. Ideally, they explain in
simple words what actions the user can take in order to resolve
the problem.Level.CONFIG
,
Level.INFO
, or Level.FINE
.
Parameters: name the name of the level.
value the integer value of the level. Please note
that the JavaTM
Logging API does not specify integer
values for standard levels (such as
Level.FINE). Therefore, a custom
level should pass an integer value that
is calculated at run-time, e.g.
(Level.FINE.intValue() + Level.CONFIG.intValue())
/ 2
for a level between FINE and CONFIG.
Level.CONFIG
, Level.INFO
, or
Level.FINE
.
Parameters: name the name of the level.
value the integer value of the level. Please note
that the JavaTM
Logging API does not specify integer
values for standard levels (such as
Level.FINE). Therefore, a custom
level should pass an integer value that
is calculated at run-time, e.g.
(Level.FINE.intValue() + Level.CONFIG.intValue())
/ 2
for a level between FINE and CONFIG.
resourceBundleName the name of a resource bundle
for localizing the level name, or null
if the name does not need to be localized.
Returns: true
if other
is an instance of
java.util.logging.Level
and has the same integer
value, false
otherwise.
Returns: the name of the resource bundle used for localizing the
level name, or null
if the name does not undergo
localization.
Throws: IllegalArgumentException if name
is neither
the name nor the integer value of one of the pre-defined standard
logging levels.
NullPointerException if name
is null.