Enum Class Loglevel

java.lang.Object
java.lang.Enum<Loglevel>
com.ns.tcpframework.logger.Loglevel
All Implemented Interfaces:
Serializable, Comparable<Loglevel>, Constable

public enum Loglevel extends Enum<Loglevel>
Enumeration representing different logging severity levels.

Each log level has an associated numeric value that determines its priority. Higher numeric values indicate more severe log levels.

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Debug level - Used for detailed diagnostic information during development.
    Error level - Used for error events that might still allow the application to continue.
    Fatal level - Used for severe error events that will presumably lead the application to abort.
    Info level - Used for informational messages about normal application flow.
    Warning level - Used for potentially harmful situations that don't prevent execution.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the numeric severity value of this log level.
    boolean
    Checks if this log level has equal or higher severity than the specified level.
    boolean
    Checks if this log level has lower severity than the specified level.
    static Loglevel
    Returns the enum constant of this class with the specified name.
    static Loglevel[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

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

    • DEBUG

      public static final Loglevel DEBUG
      Debug level - Used for detailed diagnostic information during development. Lowest severity level (0).
    • INFO

      public static final Loglevel INFO
      Info level - Used for informational messages about normal application flow. Severity level 1.
    • WARN

      public static final Loglevel WARN
      Warning level - Used for potentially harmful situations that don't prevent execution. Severity level 2.
    • ERROR

      public static final Loglevel ERROR
      Error level - Used for error events that might still allow the application to continue. Severity level 3.
    • FATAL

      public static final Loglevel FATAL
      Fatal level - Used for severe error events that will presumably lead the application to abort. Highest severity level (4).
  • Method Details

    • values

      public static Loglevel[] 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 Loglevel 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
    • getLevel

      public int getLevel()
      Gets the numeric severity value of this log level.
      Returns:
      The numeric severity value.
    • isHigherOrEqual

      public boolean isHigherOrEqual(Loglevel other)
      Checks if this log level has equal or higher severity than the specified level.
      Parameters:
      other - The log level to compare against.
      Returns:
      true if this level is higher or equal in severity, false otherwise.
    • isLowerThan

      public boolean isLowerThan(Loglevel other)
      Checks if this log level has lower severity than the specified level.
      Parameters:
      other - The log level to compare against.
      Returns:
      true if this level is lower in severity, false otherwise.