Enum Class LogLevel

java.lang.Object
java.lang.Enum<LogLevel>
me.croabeast.takion.logger.LogLevel
All Implemented Interfaces:
Serializable, Comparable<LogLevel>, java.lang.constant.Constable

public enum LogLevel extends Enum<LogLevel>
Represents different levels of logging severity. This enum provides a bridge between Bukkit's Level and custom log levels used within the Takion framework.

Each log level corresponds to one or more Java logging levels, allowing for a flexible mapping of log messages to different levels of severity.

  • 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
    Debug level: Used for highly detailed logging, including all levels of logs.
    Error level: Represents critical errors or failures that require immediate attention.
    Info level: Standard logging level for general information messages.
    Trace level: Provides fine-grained debugging information.
    Warning level: Indicates potential issues or non-critical problems that should be looked into but do not cause immediate failures.
  • Method Summary

    Modifier and Type
    Method
    Description
    static LogLevel
    fromJava(Level level)
    Retrieves the corresponding LogLevel for a given Java Level.
    Returns the name of this log level in lowercase.
    Converts this LogLevel to its corresponding Java 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 java.lang.Object

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

    • DEBUG

      public static final LogLevel DEBUG
      Debug level: Used for highly detailed logging, including all levels of logs. Typically used for diagnosing issues.
    • TRACE

      public static final LogLevel TRACE
      Trace level: Provides fine-grained debugging information. Used for tracking the execution flow and intermediate states.
    • INFO

      public static final LogLevel INFO
      Info level: Standard logging level for general information messages. These messages indicate the normal operation of the application.
    • WARN

      public static final LogLevel WARN
      Warning level: Indicates potential issues or non-critical problems that should be looked into but do not cause immediate failures.
    • ERROR

      public static final LogLevel ERROR
      Error level: Represents critical errors or failures that require immediate attention. These messages usually indicate system failures or major malfunctions.
  • 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
    • toJava

      public Level toJava()
      Converts this LogLevel to its corresponding Java Level. If multiple levels are associated, the first one is returned.
      Returns:
      The primary Level associated with this log level.
    • getName

      public String getName()
      Returns the name of this log level in lowercase. Useful for formatting or serialization purposes.
      Returns:
      The lowercase name of the log level.
    • fromJava

      public static LogLevel fromJava(Level level)
      Retrieves the corresponding LogLevel for a given Java Level. If the provided level does not match any predefined LogLevel, it defaults to DEBUG.
      Parameters:
      level - The Java logging level to map.
      Returns:
      The corresponding LogLevel, or DEBUG if no match is found.