Class Level
- java.lang.Object
-
- java.util.logging.Level
-
public class Level extends Object
Level defines a set of standard logging levels. The Level objects are ordered thanks to integer values. Levels are used to control logging output. Enabling logging at a given level also enables logging at all higher levels.Clients should normally used the predefined Level constants provided by this class. These levels are, from highest to lowest:
- SEVERE
- WARNING
- INFO
- CONFIG
- FINE
- FINER
- FINEST
- ALL to enable logging all messages.
- OFF to turn off logging.
-
-
Field Summary
Fields Modifier and Type Field Description static LevelALLALL indicates that all messages should be logged.static LevelCONFIGCONFIG is a message level for static configuration messages.static LevelFINEFINE is a message level providing tracing information.static LevelFINERFINER indicates a fairly detailed tracing message.static LevelFINESTFINEST indicates a highly detailed tracing message.static LevelINFOINFO is a message level for informational messages.static LevelOFFOFF is a special level that can be used to turn off logging.static LevelSEVERESEVERE is a message level indicating a serious failure.static LevelWARNINGWARNING is a message level indicating a potential problem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Return the name of the level.intintValue()Return the integer value of the level.StringtoString()Returns a string representation of the object.
-
-
-
Field Detail
-
OFF
public static final Level OFF
OFF is a special level that can be used to turn off logging. This level is initialized toInteger.MAX_VALUE.
-
SEVERE
public static final Level SEVERE
SEVERE is a message level indicating a serious failure.In general SEVERE messages should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators. This level is initialized to 1000.
-
WARNING
public static final Level WARNING
WARNING is a message level indicating a potential problem.In general WARNING messages should describe events that will be of interest to end users or system managers, or which indicate potential problems. This level is initialized to 900.
-
INFO
public static final Level INFO
INFO is a message level for informational messages.Typically INFO messages will be written to the console or its equivalent. So the INFO level should only be used for reasonably significant messages that will make sense to end users and system admins. This level is initialized to 800.
-
CONFIG
public static final Level CONFIG
CONFIG is a message level for static configuration messages.CONFIG messages are intended to provide a variety of static configuration information, to assist in debugging problems that may be associated with particular configurations. For example, CONFIG message might include the CPU type, the graphics depth, the GUI look-and-feel, etc. This level is initialized to 700.
-
FINE
public static final Level FINE
FINE is a message level providing tracing information.All of FINE, FINER, and FINEST are intended for relatively detailed tracing. The exact meaning of the three levels will vary between subsystems, but in general, FINEST should be used for the most voluminous detailed output, FINER for somewhat less detailed output, and FINE for the lowest volume (and most important) messages.
In general the FINE level should be used for information that will be broadly interesting to developers who do not have a specialized interest in the specific subsystem.
FINE messages might include things like minor (recoverable) failures. Issues indicating potential performance problems are also worth logging as FINE. This level is initialized to 500.
-
FINER
public static final Level FINER
FINER indicates a fairly detailed tracing message. By default logging calls for entering, returning, or throwing an exception are traced at this level. This level is initialized to 400.
-
FINEST
public static final Level FINEST
FINEST indicates a highly detailed tracing message. This level is initialized to 300.
-
ALL
public static final Level ALL
ALL indicates that all messages should be logged. This level is initialized toInteger.MIN_VALUE.
-
-
Constructor Detail
-
Level
protected Level(String name, int value)
Creates a named Level with the given integer value.- Parameters:
name- the name of the level. For example "SEVERE".value- must be one the value above.
-
-
Method Detail
-
getName
public String getName()
Return the name of the level.- Returns:
- the name.
-
intValue
public int intValue()
Return the integer value of the level. This value is useful to compare to level objects. The greater this number is, the highest the level is.- Returns:
- the integer value for this level.
-
toString
public String toString()
Description copied from class:ObjectReturns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.The
toStringmethod for classObjectreturns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:getClass().getName() + '@' + Integer.toHexString(hashCode())
-
-