Enum Class LogLevel
- All Implemented Interfaces:
Serializable,Comparable<LogLevel>,Constable
Defines the logging levels supported by the playground logging system.
Levels are ordered by severity, from ERROR (highest severity)
to TRACE (most verbose). Each level is associated with a numeric
rank used to determine whether a log message should be emitted.
For example, a logger configured with INFO will allow
ERROR, WARN, and INFO messages, but will
suppress DEBUG and TRACE messages.
- Author:
- Chakib Daii
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLogs detailed diagnostic information useful during development and troubleshooting.Logs only error conditions that prevent normal operation.Logs general informational messages about application behavior.Logs the most detailed execution information available.Logs warning conditions that may indicate a problem but do not prevent execution. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final intInternal rank used to compare logging levels. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateLogLevel(int rank) Creates a logging level with the specified rank. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this logging level permits messages of the specified level.static LogLevelfromString(String s) Converts a string representation into aLogLevel.static LogLevelReturns 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
-
ERROR
Logs only error conditions that prevent normal operation. -
WARN
Logs warning conditions that may indicate a problem but do not prevent execution. -
INFO
Logs general informational messages about application behavior. -
DEBUG
Logs detailed diagnostic information useful during development and troubleshooting. -
TRACE
Logs the most detailed execution information available.
-
-
Field Details
-
rank
final int rankInternal rank used to compare logging levels.
-
-
Constructor Details
-
LogLevel
private LogLevel(int rank) Creates a logging level with the specified rank.- Parameters:
rank- the numeric rank associated with the level
-
-
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
-
allows
Determines whether this logging level permits messages of the specified level.A level allows itself and all levels with higher severity.
- Parameters:
other- the message level to evaluate- Returns:
trueif messages atotherlevel should be logged;falseotherwise
-
fromString
Converts a string representation into aLogLevel.The comparison is case-insensitive. If the supplied value is
null, empty, or does not correspond to a valid logging level,INFOis returned.- Parameters:
s- the string representation of the log level- Returns:
- the corresponding
LogLevel, orINFOif the input is invalid
-