Package me.croabeast.takion.logger
Enum Class LogLevel
- All Implemented Interfaces:
Serializable,Comparable<LogLevel>,java.lang.constant.Constable
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 ConstantsEnum ConstantDescriptionDebug 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 TypeMethodDescriptionstatic LogLevelRetrieves the correspondingLogLevelfor a given JavaLevel.getName()Returns the name of this log level in lowercase.toJava()Converts thisLogLevelto its corresponding JavaLevel.static LogLevelReturns the enum constant of this class with the specified name.static LogLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEBUG
Debug level: Used for highly detailed logging, including all levels of logs. Typically used for diagnosing issues. -
TRACE
Trace level: Provides fine-grained debugging information. Used for tracking the execution flow and intermediate states. -
INFO
Info level: Standard logging level for general information messages. These messages indicate the normal operation of the application. -
WARN
Warning level: Indicates potential issues or non-critical problems that should be looked into but do not cause immediate failures. -
ERROR
Error level: Represents critical errors or failures that require immediate attention. These messages usually indicate system failures or major malfunctions.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
toJava
Converts thisLogLevelto its corresponding JavaLevel. If multiple levels are associated, the first one is returned.- Returns:
- The primary
Levelassociated with this log level.
-
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
Retrieves the correspondingLogLevelfor a given JavaLevel. If the provided level does not match any predefinedLogLevel, it defaults toDEBUG.- Parameters:
level- The Java logging level to map.- Returns:
- The corresponding
LogLevel, orDEBUGif no match is found.
-