Package org.silverpeas.kernel.logging
Enum Level
- All Implemented Interfaces:
Serializable,Comparable<Level>,java.lang.constant.Constable
The different logging levels taken in charge by the Silverpeas logger. Such levels define in what
a message is important: the higher the level is, the more important the message is. The loggers
have also a logging level from which they accept to write out the messages: all messages with a
level greater or equal than its own level will be taken in charge; the loggers level define the
lower level of messages they accept to log.
Because each logging solution in the Java ecosystem defines their own logging level, it is required to abstract them in order to be agnostic to any logging mechanisms.
This Level enumeration defines a set of standard logging levels that can be used to control logging output. The logging Level objects are ordered and are specified by ordered integers. Enabling logging at a given level also enables logging at all higher levels.
- Author:
- mmoquillon
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe lower logging level: this level includes all the below levels; whatever their level, the messages will be written into the logs.The ERROR level: only messages with the tracing level of ERROR will be written into the logs.The INFO level: only messages with the tracing level of INFO, WARNING and ERROR will be written into the logs.The WARNING level: only messages with the tracing level of WARNING and ERROR will be written into the logs. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisGreaterOrEqual(Level level) Is this level is greater or equal to the specified logging level?intvalue()Gets the level value of this logging level.static LevelReturns the enum constant of this type with the specified name.static Level[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DEBUG
The lower logging level: this level includes all the below levels; whatever their level, the messages will be written into the logs. -
INFO
The INFO level: only messages with the tracing level of INFO, WARNING and ERROR will be written into the logs. -
WARNING
The WARNING level: only messages with the tracing level of WARNING and ERROR will be written into the logs. -
ERROR
The ERROR level: only messages with the tracing level of ERROR will be written into the logs.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
value
public int value()Gets the level value of this logging level. The higher the value is, the more important the level is.- Returns:
- an integer indicating the importance of the level.
-
isGreaterOrEqual
Is this level is greater or equal to the specified logging level?- Parameters:
level- another logging level- Returns:
- true if this level is more important or equally important than the given other level.
-