Top Description Fields Constructors Methods
ch.qos.logback.classic

public final Class Level

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
org.slf4j.event.EventConstants, org.slf4j.spi.LocationAwareLogger

Defines the set of levels recognized by logback-classic, that is OFF, ERROR, WARN, INFO, DEBUG, TRACE and ALL.

The Level class is final and cannot be sub-classed.

Field Summary

Modifier and TypeField and Description
public static final Level
ALL

The ALL is used to turn on all logging.

public static final int
public static final Integer
public static final Level
DEBUG

The DEBUG level designates informational events of lower importance.

public static final int
public static final Integer
public static final Level
ERROR

The ERROR level designates error events which may or not be fatal to the application.

public static final int
public static final Integer
public static final Level
INFO

The INFO level designates informational messages highlighting overall progress of the application.

public static final int
public static final Integer
public final int
public final String
public static final Level
OFF

The OFF is used to turn off logging.

public static final int
public static final Integer
private static final long
public static final Level
TRACE

The TRACE level designates informational events of very low importance.

public static final int
public static final Integer
public static final Level
WARN

The WARN level designates potentially harmful situations.

public static final int
public static final Integer

Constructor Summary

AccessConstructor and Description
private
Level(int levelInt, String levelStr)

Instantiate a Level object.

Method Summary

Modifier and TypeMethod and Description
public static Level
public static Level

Returns:

an instance of this class, i.e. a Level.
fromLocationAwareLoggerInteger
(int
An integer value representing a level as defined in LocationAwareLogger
levelInt
)

Convert one of the integer values defined in LocationAwareLogger interface to an instance of this class, i.e. a Level.

public boolean
isGreaterOrEqual(Level r)

Returns true if this Level has a higher or equal Level than the Level passed as argument, false otherwise.

private Object

Returns:

The appropriate flyweight instance
readResolve
()

Return the flyweight instance of the level received through serialization, i.e. 'this'.

public int
toInt()

Returns the integer representation of this Level.

public Integer

Returns:

This level's Integer mapping.
toInteger
()

Convert a Level to an Integer object.

public static Level
toLevel(String sArg)

Convert the string passed as argument to a Level.

public static Level
toLevel(int val)

Convert an integer passed as argument to a Level.

public static Level
toLevel(int val, Level defaultLevel)

Convert an integer passed as argument to a Level.

public static Level
toLevel(final String sArg, Level defaultLevel)

Convert the string passed as argument to a Level.

public static int

Returns:

int An integer corresponding to this level as defined in LocationAwareLogger
toLocationAwareLoggerInteger
(Level
The level to convert to LocationAwareLogger integer
level
)

Convert this level instance to an integer value defined in the LocationAwareLogger interface.

public String
toString()

Overrides java.lang.Object.toString.

Returns the string representation of this Level.
public static Level
valueOf(String sArg)

This method exists in order to comply with Joran's valueOf convention.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ALLback to summary
public static final Level ALL

The ALL is used to turn on all logging.

ALL_INTback to summary
public static final int ALL_INT
ALL_INTEGERback to summary
public static final Integer ALL_INTEGER
DEBUGback to summary
public static final Level DEBUG

The DEBUG level designates informational events of lower importance.

DEBUG_INTback to summary
public static final int DEBUG_INT
DEBUG_INTEGERback to summary
public static final Integer DEBUG_INTEGER
ERRORback to summary
public static final Level ERROR

The ERROR level designates error events which may or not be fatal to the application.

ERROR_INTback to summary
public static final int ERROR_INT
ERROR_INTEGERback to summary
public static final Integer ERROR_INTEGER
INFOback to summary
public static final Level INFO

The INFO level designates informational messages highlighting overall progress of the application.

INFO_INTback to summary
public static final int INFO_INT
INFO_INTEGERback to summary
public static final Integer INFO_INTEGER
levelIntback to summary
public final int levelInt
levelStrback to summary
public final String levelStr
OFFback to summary
public static final Level OFF

The OFF is used to turn off logging.

OFF_INTback to summary
public static final int OFF_INT
OFF_INTEGERback to summary
public static final Integer OFF_INTEGER
serialVersionUIDback to summary
private static final long serialVersionUID
TRACEback to summary
public static final Level TRACE

The TRACE level designates informational events of very low importance.

TRACE_INTback to summary
public static final int TRACE_INT
TRACE_INTEGERback to summary
public static final Integer TRACE_INTEGER
WARNback to summary
public static final Level WARN

The WARN level designates potentially harmful situations.

WARN_INTback to summary
public static final int WARN_INT
WARN_INTEGERback to summary
public static final Integer WARN_INTEGER

Constructor Detail

Levelback to summary
private Level(int levelInt, String levelStr)

Instantiate a Level object.

Method Detail

convertAnSLF4JLevelback to summary
public static Level convertAnSLF4JLevel(Level slf4jLevel)
fromLocationAwareLoggerIntegerback to summary
public static Level fromLocationAwareLoggerInteger(int levelInt)

Convert one of the integer values defined in LocationAwareLogger interface to an instance of this class, i.e. a Level.

Parameters
levelInt:int

An integer value representing a level as defined in LocationAwareLogger

Returns:Level

an instance of this class, i.e. a Level.

Since
1.0.1
isGreaterOrEqualback to summary
public boolean isGreaterOrEqual(Level r)

Returns true if this Level has a higher or equal Level than the Level passed as argument, false otherwise.

readResolveback to summary
private Object readResolve()

Return the flyweight instance of the level received through serialization, i.e. 'this'.

Returns:Object

The appropriate flyweight instance

toIntback to summary
public int toInt()

Returns the integer representation of this Level.

toIntegerback to summary
public Integer toInteger()

Convert a Level to an Integer object.

Returns:Integer

This level's Integer mapping.

toLevelback to summary
public static Level toLevel(String sArg)

Convert the string passed as argument to a Level. If the conversion fails, then this method returns DEBUG.

toLevelback to summary
public static Level toLevel(int val)

Convert an integer passed as argument to a Level. If the conversion fails, then this method returns DEBUG.

toLevelback to summary
public static Level toLevel(int val, Level defaultLevel)

Convert an integer passed as argument to a Level. If the conversion fails, then this method returns the specified default.

toLevelback to summary
public static Level toLevel(final String sArg, Level defaultLevel)

Convert the string passed as argument to a Level. If the conversion fails, then this method returns the value of defaultLevel.

toLocationAwareLoggerIntegerback to summary
public static int toLocationAwareLoggerInteger(Level level)

Convert this level instance to an integer value defined in the LocationAwareLogger interface.

Parameters
level:Level

The level to convert to LocationAwareLogger integer

Returns:int

int An integer corresponding to this level as defined in LocationAwareLogger

Since
1.0.1
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the string representation of this Level.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

valueOfback to summary
public static Level valueOf(String sArg)

This method exists in order to comply with Joran's valueOf convention.