Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var COLORS = []string{ PANIC: "9", FATAL: "160", ERROR: "1", SUCCESS: "2", MESSAGE: "7", WARN: "3", INFO: "4", DEBUG: "6", TRACE: "7", }
COLORS maps log level constants to their corresponding color codes.
View Source
var LABELS = []string{ OFF: "OFF", PANIC: "PANIC", FATAL: "FATAL", ERROR: "ERROR", SUCCESS: "SUCCESS", MESSAGE: "MESSAGE", WARN: "WARN", INFO: "INFO", DEBUG: "DEBUG", TRACE: "TRACE", }
LABELS maps log level constants to their corresponding string labels.
Functions ¶
This section is empty.
Types ¶
type TYPE ¶
type TYPE uint8
TYPE represents the log level type.
const ( OFF TYPE = iota // OFF disables logging. PANIC // PANIC for critical errors leading to termination. FATAL // FATAL for severe errors that may cause termination. ERROR // ERROR for non-fatal errors. WARN // WARN for warning messages. SUCCESS // SUCCESS for successful operations. MESSAGE // MESSAGE for general messages. INFO // INFO for informational messages. DEBUG // DEBUG for debugging messages. TRACE // TRACE for detailed tracing. DEFAULT = INFO // DEFAULT is the default log level, set to INFO. )
Log level constants.
func (TYPE) Color ¶
Color returns the color code associated with the log level. This method is useful for color-coding log messages.
Returns: - string: The color code for the log level, or "UNKNOWN" if the level is not defined.
Click to show internal directories.
Click to hide internal directories.