- java.lang.Object
-
- ch.qos.logback.classic.Level
-
- All Implemented Interfaces:
Serializable
public final class Level extends Object implements Serializable
Defines the set of levels recognized by logback-classic, that isOFF,ERROR,WARN,INFO,DEBUG,TRACEandALL. TheLevelclass is final and cannot be sub-classed.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static LevelALLDeprecated.with no replacementstatic intALL_INTstatic IntegerALL_INTEGERstatic LevelDEBUGTheDEBUGlevel designates informational events of lower importance.static intDEBUG_INTstatic IntegerDEBUG_INTEGERstatic LevelERRORTheERRORlevel designates error events which may or not be fatal to the application.static intERROR_INTstatic IntegerERROR_INTEGERstatic LevelINFOTheINFOlevel designates informational messages highlighting overall progress of the application.static intINFO_INTstatic IntegerINFO_INTEGERintlevelIntStringlevelStrstatic LevelOFFTheOFFis used to turn off logging.static intOFF_INTstatic IntegerOFF_INTEGERstatic LevelTRACETheTRACElevel designates informational events of very low importance.static intTRACE_INTstatic IntegerTRACE_INTEGERstatic LevelWARNTheWARNlevel designates potentially harmful situations.static intWARN_INTstatic IntegerWARN_INTEGER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LevelconvertAnSLF4JLevel(org.slf4j.event.Level slf4jLevel)static LevelfromLocationAwareLoggerInteger(int levelInt)Convert one of the integer values defined inLocationAwareLoggerinterface to an instance of this class, i.e. a Level.booleanisGreaterOrEqual(Level r)Returnstrueif this Level has a higher or equal Level than the Level passed as argument,falseotherwise.inttoInt()Returns the integer representation of this Level.IntegertoInteger()Convert a Level to an Integer object.static LeveltoLevel(int val)Convert an integer passed as argument to a Level.static LeveltoLevel(int val, Level defaultLevel)Convert an integer passed as argument to a Level.static LeveltoLevel(String sArg)Convert the string passed as argument to a Level.static LeveltoLevel(String sArg, Level defaultLevel)Convert the string passed as argument to a Level.static inttoLocationAwareLoggerInteger(Level level)Convert this level instance to an integer value defined in theLocationAwareLoggerinterface.StringtoString()Returns the string representation of this Level.static LevelvalueOf(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 Integer OFF_INTEGER
-
ERROR_INTEGER
public static final Integer ERROR_INTEGER
-
WARN_INTEGER
public static final Integer WARN_INTEGER
-
INFO_INTEGER
public static final Integer INFO_INTEGER
-
DEBUG_INTEGER
public static final Integer DEBUG_INTEGER
-
TRACE_INTEGER
public static final Integer TRACE_INTEGER
-
ALL_INTEGER
public static final Integer ALL_INTEGER
-
OFF
public static final Level OFF
TheOFFis used to turn off logging. It is intended to be used for logging system configuration. Warning: it should never be passed as an argument to logger methods in a regular log statement.
-
ERROR
public static final Level ERROR
TheERRORlevel designates error events which may or not be fatal to the application.
-
INFO
public static final Level INFO
TheINFOlevel designates informational messages highlighting overall progress of the application.
-
DEBUG
public static final Level DEBUG
TheDEBUGlevel designates informational events of lower importance.
-
TRACE
public static final Level TRACE
TheTRACElevel designates informational events of very low importance.
-
ALL
public static final Level ALL
Deprecated.with no replacementThe
ALLis used to turn on all logging. TheALLlevel is vestigial from log4j 1.x.In logback, where the Level class is final, logging can be turned on for all levels by setting a logger's level to
TRACE.Thus, the
ALLlevel is marked as deprecated.
-
levelInt
public final int levelInt
-
-
Method Detail
-
toInt
public int toInt()
Returns the integer representation of this Level.
-
convertAnSLF4JLevel
public static Level convertAnSLF4JLevel(org.slf4j.event.Level slf4jLevel)
-
toInteger
public Integer toInteger()
Convert a Level to an Integer object.- Returns:
- This level's Integer mapping.
-
isGreaterOrEqual
public boolean isGreaterOrEqual(Level r)
Returnstrueif this Level has a higher or equal Level than the Level passed as argument,falseotherwise.
-
toLevel
public static Level toLevel(String sArg)
Convert the string passed as argument to a Level. If the conversion fails, then this method returnsDEBUG.
-
valueOf
public static Level valueOf(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(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 inLocationAwareLoggerinterface 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 theLocationAwareLoggerinterface.- 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
-
-