Package ch.qos.logback.classic
Class Level
- java.lang.Object
-
- ch.qos.logback.classic.Level
-
- All Implemented Interfaces:
java.io.Serializable
public final class Level extends java.lang.Object implements java.io.Serializable
Defines the set of levels recognized by logback-classic, that isOFF
,ERROR
,WARN
,INFO
,DEBUG
,TRACE
andALL
. TheLevel
class is final and cannot be sub-classed.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Level
ALL
TheALL
is used to turn on all logging.static int
ALL_INT
static java.lang.Integer
ALL_INTEGER
static Level
DEBUG
TheDEBUG
level designates informational events of lower importance.static int
DEBUG_INT
static java.lang.Integer
DEBUG_INTEGER
static Level
ERROR
TheERROR
level designates error events which may or not be fatal to the application.static int
ERROR_INT
static java.lang.Integer
ERROR_INTEGER
static Level
INFO
TheINFO
level designates informational messages highlighting overall progress of the application.static int
INFO_INT
static java.lang.Integer
INFO_INTEGER
int
levelInt
java.lang.String
levelStr
static Level
OFF
TheOFF
is used to turn off logging.static int
OFF_INT
static java.lang.Integer
OFF_INTEGER
static Level
TRACE
TheTRACE
level designates informational events of very low importance.static int
TRACE_INT
static java.lang.Integer
TRACE_INTEGER
static Level
WARN
TheWARN
level designates potentially harmful situations.static int
WARN_INT
static java.lang.Integer
WARN_INTEGER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Level
fromLocationAwareLoggerInteger(int levelInt)
Convert one of the integer values defined inLocationAwareLogger
interface to an instance of this class, i.e.boolean
isGreaterOrEqual(Level r)
Returnstrue
if this Level has a higher or equal Level than the Level passed as argument,false
otherwise.int
toInt()
Returns the integer representation of this Level.java.lang.Integer
toInteger()
Convert a Level to an Integer object.static Level
toLevel(int val)
Convert an integer passed as argument to a Level.static Level
toLevel(int val, Level defaultLevel)
Convert an integer passed as argument to a Level.static Level
toLevel(java.lang.String sArg)
Convert the string passed as argument to a Level.static Level
toLevel(java.lang.String sArg, Level defaultLevel)
Convert the string passed as argument to a Level.static int
toLocationAwareLoggerInteger(Level level)
Convert this level instance to an integer value defined in theLocationAwareLogger
interface.java.lang.String
toString()
Returns the string representation of this Level.static Level
valueOf(java.lang.String sArg)
This method exists in order to comply with Joran's valueOf convention.
-
-
-
Field Detail
-
OFF_INT
public static final int OFF_INT
- See Also:
- Constant Field Values
-
ERROR_INT
public static final int ERROR_INT
- See Also:
- Constant Field Values
-
WARN_INT
public static final int WARN_INT
- See Also:
- Constant Field Values
-
INFO_INT
public static final int INFO_INT
- See Also:
- Constant Field Values
-
DEBUG_INT
public static final int DEBUG_INT
- See Also:
- Constant Field Values
-
TRACE_INT
public static final int TRACE_INT
- See Also:
- Constant Field Values
-
ALL_INT
public static final int ALL_INT
- See Also:
- Constant Field Values
-
OFF_INTEGER
public static final java.lang.Integer OFF_INTEGER
-
ERROR_INTEGER
public static final java.lang.Integer ERROR_INTEGER
-
WARN_INTEGER
public static final java.lang.Integer WARN_INTEGER
-
INFO_INTEGER
public static final java.lang.Integer INFO_INTEGER
-
DEBUG_INTEGER
public static final java.lang.Integer DEBUG_INTEGER
-
TRACE_INTEGER
public static final java.lang.Integer TRACE_INTEGER
-
ALL_INTEGER
public static final java.lang.Integer ALL_INTEGER
-
OFF
public static final Level OFF
TheOFF
is used to turn off logging.
-
ERROR
public static final Level ERROR
TheERROR
level designates error events which may or not be fatal to the application.
-
WARN
public static final Level WARN
TheWARN
level designates potentially harmful situations.
-
INFO
public static final Level INFO
TheINFO
level designates informational messages highlighting overall progress of the application.
-
DEBUG
public static final Level DEBUG
TheDEBUG
level designates informational events of lower importance.
-
TRACE
public static final Level TRACE
TheTRACE
level designates informational events of very low importance.
-
ALL
public static final Level ALL
TheALL
is used to turn on all logging.
-
levelInt
public final int levelInt
-
levelStr
public final java.lang.String levelStr
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns the string representation of this Level.- Overrides:
toString
in classjava.lang.Object
-
toInt
public int toInt()
Returns the integer representation of this Level.
-
toInteger
public java.lang.Integer toInteger()
Convert a Level to an Integer object.- Returns:
- This level's Integer mapping.
-
isGreaterOrEqual
public boolean isGreaterOrEqual(Level r)
Returnstrue
if this Level has a higher or equal Level than the Level passed as argument,false
otherwise.
-
toLevel
public static Level toLevel(java.lang.String sArg)
Convert the string passed as argument to a Level. If the conversion fails, then this method returnsDEBUG
.
-
valueOf
public static Level valueOf(java.lang.String sArg)
This method exists in order to comply with Joran's valueOf convention.- Parameters:
sArg
-- Returns:
-
toLevel
public static Level toLevel(int val)
Convert an integer passed as argument to a Level. If the conversion fails, then this method returnsDEBUG
.
-
toLevel
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.
-
toLevel
public static Level toLevel(java.lang.String sArg, Level defaultLevel)
Convert the string passed as argument to a Level. If the conversion fails, then this method returns the value ofdefaultLevel
.
-
fromLocationAwareLoggerInteger
public static Level fromLocationAwareLoggerInteger(int levelInt)
Convert one of the integer values defined inLocationAwareLogger
interface to an instance of this class, i.e. a Level.- Parameters:
levelInt
- An integer value representing a level as defined in LocationAwareLogger- Returns:
- an instance of this class, i.e. a Level.
- Since:
- 1.0.1
-
toLocationAwareLoggerInteger
public static int toLocationAwareLoggerInteger(Level level)
Convert this level instance to an integer value defined in theLocationAwareLogger
interface.- Parameters:
level
- The level to convert to LocationAwareLogger integer- Returns:
- int An integer corresponding to this level as defined in LocationAwareLogger
- Since:
- 1.0.1
-
-