Enum Level

java.lang.Object
java.lang.Enum<Level>
org.silverpeas.kernel.logging.Level
All Implemented Interfaces:
Serializable, Comparable<Level>, java.lang.constant.Constable

public enum Level extends Enum<Level>
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 Constants
    Enum Constant
    Description
    The 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 Type
    Method
    Description
    boolean
    Is this level is greater or equal to the specified logging level?
    int
    Gets the level value of this logging level.
    static Level
    Returns the enum constant of this type with the specified name.
    static Level[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DEBUG

      public static final Level DEBUG
      The lower logging level: this level includes all the below levels; whatever their level, the messages will be written into the logs.
    • INFO

      public static final Level INFO
      The INFO level: only messages with the tracing level of INFO, WARNING and ERROR will be written into the logs.
    • WARNING

      public static final Level WARNING
      The WARNING level: only messages with the tracing level of WARNING and ERROR will be written into the logs.
    • ERROR

      public static final Level ERROR
      The ERROR level: only messages with the tracing level of ERROR will be written into the logs.
  • Method Details

    • values

      public static Level[] 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

      public static Level valueOf(String name)
      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 name
      NullPointerException - 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

      public boolean isGreaterOrEqual(Level level)
      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.