Package com.log4rich.core
Enum Class LogLevel
- All Implemented Interfaces:
Serializable
,Comparable<LogLevel>
,Constable
Enumeration of logging levels supported by log4Rich.
Levels are ordered from most verbose (TRACE) to least verbose (OFF).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDebug level for detailed diagnostic informationError level for error events that still allow application to continueFatal level for severe error events that will lead to application terminationGeneral information about application progressTurns off all loggingMost verbose logging level, shows all messagesWarning level for potentially harmful situations -
Method Summary
Modifier and TypeMethodDescriptionstatic LogLevel
fromString
(String level) Parse a string to get the corresponding LogLevel.int
getValue()
Gets the numeric value of this log level.boolean
isGreaterOrEqual
(LogLevel level) Check if this level is enabled for the given level.static LogLevel
Returns the enum constant of this class with the specified name.static LogLevel[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TRACE
Most verbose logging level, shows all messages -
DEBUG
Debug level for detailed diagnostic information -
INFO
General information about application progress -
WARN
Warning level for potentially harmful situations -
ERROR
Error level for error events that still allow application to continue -
FATAL
Fatal level for severe error events that will lead to application termination -
OFF
Turns off all logging
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public int getValue()Gets the numeric value of this log level. Lower values indicate more verbose logging.- Returns:
- the numeric value of this log level
-
isGreaterOrEqual
Check if this level is enabled for the given level.- Parameters:
level
- The level to check against- Returns:
- true if this level is greater than or equal to the given level
-
fromString
Parse a string to get the corresponding LogLevel.- Parameters:
level
- The string representation of the level- Returns:
- The corresponding LogLevel, or INFO if not found
-