Name
Level
Synopsis
This class
defines constants that represent the seven standard severity levels
for log messages plus constants that turn logging off and enable
logging at any level. When logging is enabled at one severity level,
it is also enabled at all higher levels. The seven level constants,
in order from most severe to least severe are:
SEVERE
, WARNING
,
INFO
, CONFIG
,
FINE
, FINER
, and
FINEST
. The constant ALL
enable
logging of any message, regardless of its level. The constant
OFF
disables logging entirely. Note that these
constants are all Level
objects, rather than
integers. This provides type safety.
Application code should rarely, if ever, need to use any of the methods of this class: instead they can simply use the constants it defines.
Figure 16-116. java.util.logging.Level
public class Level implements Serializable { // Protected Constructors protected Level(String name, int value); protected Level(String name, int value, String resourceBundleName); // Public Constants public static final Level ALL; public static final Level CONFIG; public static final Level FINE; public static final Level FINER; public static final Level FINEST; public static final Level INFO; public static final Level OFF; public static final Level SEVERE; public static final Level WARNING; // Public Class Methods public static Level parse(String name) throws IllegalArgumentException; synchronized // ...
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.