Package ch.qos.logback.classic
Class Level
java.lang.Object
ch.qos.logback.classic.Level
- All Implemented Interfaces:
Serializable
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LevelTheALLis used to turn on all logging.static final intstatic final Integerstatic final LevelTheDEBUGlevel designates informational events of lower importance.static final intstatic final Integerstatic final LevelTheERRORlevel designates error events which may or not be fatal to the application.static final intstatic final Integerstatic final LevelTheINFOlevel designates informational messages highlighting overall progress of the application.static final intstatic final Integerfinal intfinal Stringstatic final LevelTheOFFis used to turn off logging.static final intstatic final Integerprivate static final longstatic final LevelTheTRACElevel designates informational events of very low importance.static final intstatic final Integerstatic final LevelTheWARNlevel designates potentially harmful situations.static final intstatic final Integer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LevelfromLocationAwareLoggerInteger(int levelInt) Convert one of the integer values defined inLocationAwareLoggerinterface to an instance of this class, i.e.booleanReturnstrueif this Level has a higher or equal Level than the Level passed as argument,falseotherwise.private ObjectReturn the flyweight instance of the level received through serizalization, i.e.inttoInt()Returns the integer representation of this Level.Convert a Level to an Integer object.static LeveltoLevel(int val) Convert an integer passed as argument to a Level.static LevelConvert an integer passed as argument to a Level.static LevelConvert the string passed as argument to a Level.static LevelConvert the string passed as argument to a Level.static intConvert this level instance to an integer value defined in theLocationAwareLoggerinterface.toString()Returns the string representation of this Level.static LevelThis method exists in order to comply with Joran's valueOf convention.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
OFF_INT
public static final int OFF_INT- See Also:
-
ERROR_INT
public static final int ERROR_INT- See Also:
-
WARN_INT
public static final int WARN_INT- See Also:
-
INFO_INT
public static final int INFO_INT- See Also:
-
DEBUG_INT
public static final int DEBUG_INT- See Also:
-
TRACE_INT
public static final int TRACE_INT- See Also:
-
ALL_INT
public static final int ALL_INT- See Also:
-
OFF_INTEGER
-
ERROR_INTEGER
-
WARN_INTEGER
-
INFO_INTEGER
-
DEBUG_INTEGER
-
TRACE_INTEGER
-
ALL_INTEGER
-
OFF
TheOFFis used to turn off logging. -
ERROR
TheERRORlevel designates error events which may or not be fatal to the application. -
WARN
TheWARNlevel designates potentially harmful situations. -
INFO
TheINFOlevel designates informational messages highlighting overall progress of the application. -
DEBUG
TheDEBUGlevel designates informational events of lower importance. -
TRACE
TheTRACElevel designates informational events of very low importance. -
ALL
TheALLis used to turn on all logging. -
levelInt
public final int levelInt -
levelStr
-
-
Constructor Details
-
Level
Instantiate a Level object.
-
-
Method Details
-
toString
Returns the string representation of this Level. -
toInt
public int toInt()Returns the integer representation of this Level. -
toInteger
Convert a Level to an Integer object.- Returns:
- This level's Integer mapping.
-
isGreaterOrEqual
Returnstrueif this Level has a higher or equal Level than the Level passed as argument,falseotherwise. -
toLevel
Convert the string passed as argument to a Level. If the conversion fails, then this method returnsDEBUG. -
valueOf
This method exists in order to comply with Joran's valueOf convention.- Parameters:
sArg-- Returns:
-
toLevel
Convert an integer passed as argument to a Level. If the conversion fails, then this method returnsDEBUG. -
toLevel
Convert an integer passed as argument to a Level. If the conversion fails, then this method returns the specified default. -
toLevel
Convert the string passed as argument to a Level. If the conversion fails, then this method returns the value ofdefaultLevel. -
readResolve
Return the flyweight instance of the level received through serizalization, i.e. 'this'.- Returns:
- The appropriate flyweight instance
-
fromLocationAwareLoggerInteger
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
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
-