|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.logging.Level
public class Level
A class for indicating logging levels. A number of commonly used
levels is pre-defined (such as 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". |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Level OFF
OFF
level is used as a threshold for filtering
log records, meaning that no message should be logged.
Logger.setLevel(java.util.logging.Level)
public static final Level SEVERE
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.
public static final Level WARNING
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.
public static final Level INFO
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.
public static final Level CONFIG
CONFIG
are used for
describing the static configuration, for example the windowing
environment, the operating system version, etc.
public static final Level FINE
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.
public static final Level FINER
FINER
are intended for
rather detailed tracing, for example entering a method, returning
from a method, or throwing an exception.
public static final Level FINEST
FINEST
are used for
highly detailed tracing, for example to indicate that a certain
point inside the body of a method has been reached.
public static final Level ALL
ALL
level is used as a threshold for filtering
log records, meaning that every message should be logged.
Logger.setLevel(java.util.logging.Level)
Constructor Detail |
---|
protected Level(String name, int value)
Level.CONFIG
,
Level.INFO
, or Level.FINE
.
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.protected Level(String name, int value, String resourceBundleName)
Level.CONFIG
, Level.INFO
, or
Level.FINE
.
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.Method Detail |
---|
public String getResourceBundleName()
null
if the name does not undergo
localization.public String getName()
public String getLocalizedName()
public final String toString()
toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)
public final int intValue()
public static Level parse(String name) throws IllegalArgumentException
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.public boolean equals(Object other)
equals
in class Object
other
- the Object to compare to
true
if other
is an instance of
java.util.logging.Level
and has the same integer
value, false
otherwise.Object.hashCode()
public int hashCode()
hashCode
in class Object
Object.equals(Object)
,
System.identityHashCode(Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |