Skip to content

Most visited

Recently visited

navigation
Added in API level 1

Level

public class Level
extends Object implements Serializable

java.lang.Object
   ↳ java.util.logging.Level


Level objects are used to indicate the level of logging. There are a set of predefined logging levels, each associated with an integer value. Enabling a certain logging level also enables all logging levels with larger values.

The predefined levels in ascending order are FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE. There are two additional predefined levels, which are ALL and OFF. ALL indicates logging all messages, and OFF indicates logging no messages.

Summary

Fields

public static final Level ALL

The ALL level provides all logging messages.

public static final Level CONFIG

The CONFIG level provides static configuration messages.

public static final Level FINE

The FINE level provides tracing messages.

public static final Level FINER

The FINER level provides more detailed tracing messages.

public static final Level FINEST

The FINEST level provides highly detailed tracing messages.

public static final Level INFO

The INFO level provides informative messages.

public static final Level OFF

The OFF level provides no logging messages.

public static final Level SEVERE

The SEVERE level provides severe failure messages.

public static final Level WARNING

The WARNING level provides warnings.

Protected constructors

Level(String name, int level)

Constructs an instance of Level taking the supplied name and level value.

Level(String name, int level, String resourceBundleName)

Constructs an instance of Level taking the supplied name, level value and resource bundle name.

Public methods

boolean equals(Object o)

Compares two Level objects for equality.

String getLocalizedName()

Gets the localized name of this level.

String getName()

Gets the name of this level.

String getResourceBundleName()

Gets the name of the resource bundle associated with this level.

int hashCode()

Returns the hash code of this Level object.

final int intValue()

Gets the integer value indicating this level.

static Level parse(String name)

Parses a level name into a Level object.

final String toString()

Returns the string representation of this Level object.

Inherited methods

From class java.lang.Object

Fields

ALL

Added in API level 1
Level ALL

The ALL level provides all logging messages.

CONFIG

Added in API level 1
Level CONFIG

The CONFIG level provides static configuration messages.

FINE

Added in API level 1
Level FINE

The FINE level provides tracing messages.

FINER

Added in API level 1
Level FINER

The FINER level provides more detailed tracing messages.

FINEST

Added in API level 1
Level FINEST

The FINEST level provides highly detailed tracing messages.

INFO

Added in API level 1
Level INFO

The INFO level provides informative messages.

OFF

Added in API level 1
Level OFF

The OFF level provides no logging messages.

SEVERE

Added in API level 1
Level SEVERE

The SEVERE level provides severe failure messages.

WARNING

Added in API level 1
Level WARNING

The WARNING level provides warnings.

Protected constructors

Level

Added in API level 1
Level (String name, 
                int level)

Constructs an instance of Level taking the supplied name and level value.

Parameters
name String: the name of the level.
level int: an integer value indicating the level.
Throws
NullPointerException if name is null.

Level

Added in API level 1
Level (String name, 
                int level, 
                String resourceBundleName)

Constructs an instance of Level taking the supplied name, level value and resource bundle name.

Parameters
name String: the name of the level.
level int: an integer value indicating the level.
resourceBundleName String: the name of the resource bundle to use.
Throws
NullPointerException if name is null.

Public methods

equals

Added in API level 1
boolean equals (Object o)

Compares two Level objects for equality. They are considered to be equal if they have the same level value.

Parameters
o Object: the other object to compare this level to.
Returns
boolean true if this object equals to the supplied object, false otherwise.

getLocalizedName

Added in API level 1
String getLocalizedName ()

Gets the localized name of this level. The default locale is used. If no resource bundle is associated with this level then the original level name is returned.

Returns
String the localized name of this level.

getName

Added in API level 1
String getName ()

Gets the name of this level.

Returns
String this level's name.

getResourceBundleName

Added in API level 1
String getResourceBundleName ()

Gets the name of the resource bundle associated with this level.

Returns
String the name of this level's resource bundle.

hashCode

Added in API level 1
int hashCode ()

Returns the hash code of this Level object.

Returns
int this level's hash code.

intValue

Added in API level 1
int intValue ()

Gets the integer value indicating this level.

Returns
int this level's integer value.

parse

Added in API level 1
Level parse (String name)

Parses a level name into a Level object.

Parameters
name String: the name of the desired level, which cannot be null.
Returns
Level the level with the specified name.
Throws
NullPointerException if name is null.
IllegalArgumentException if name is not valid.

toString

Added in API level 1
String toString ()

Returns the string representation of this Level object. In this case, it is the level's name.

Returns
String the string representation of this level.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.