Enum Class Log.Level

java.lang.Object
java.lang.Enum<Log.Level>
edu.cnu.mdi.log.Log.Level
All Implemented Interfaces:
Serializable, Comparable<Log.Level>, Constable
Enclosing class:
Log

public static enum Log.Level extends Enum<Log.Level>
Severity levels for log messages.

Each constant carries its own dispatch logic via an abstract dispatch(ILogListener, String) method, eliminating the need for a switch statement in the notification loop.

  • Enum Constant Details

    • INFO

      public static final Log.Level INFO
      Normal application events.
    • CONFIG

      public static final Log.Level CONFIG
      Application configuration and setup events.
    • WARNING

      public static final Log.Level WARNING
      Recoverable problems or unexpected conditions.
    • ERROR

      public static final Log.Level ERROR
      Significant failures that may have prevented an operation.
    • EXCEPTION

      public static final Log.Level EXCEPTION
      Unhandled exceptions.

      The message contains the full stack trace produced by Log.exception(Throwable).

  • Method Details

    • values

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

      public static Log.Level valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • dispatch

      public abstract void dispatch(ILogListener listener, String message)
      Dispatch message to the appropriate method on listener for this level.
      Parameters:
      listener - the target listener; never null
      message - the log message; never null