Documentation
¶
Index ¶
- Variables
- func Create(output io.Writer) (regular *log.Logger, trace *log.Logger)
- func DetectLevel()
- func DetectTrace() bool
- func DetectTraceEnv() bool
- func GetLevel() log.Level
- func Init(output io.Writer)
- func SetLevel(level log.Level)
- func Swap(output io.Writer) func()
- func ToggleTrace(toggle bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TraceLevel = log.DebugLevel - 4 DebugLevel = log.DebugLevel InfoLevel = log.InfoLevel WarnLevel = log.WarnLevel ErrorLevel = log.ErrorLevel FatalLevel = log.FatalLevel NoLogsLevel = log.Level(50) )
Our custom log levels
View Source
var (
Trace, Debug, Info, Warn, Error, Fatal func(msg any, keyVals ...any)
)
Public function bindings for the default logger
Functions ¶
func DetectLevel ¶
func DetectLevel()
DetectLevel detects the appropriate level based on the DEBUG environment variable's contents.
func DetectTrace ¶
func DetectTrace() bool
DetectTrace detects if the DEBUG environment variable is set to trace and enables trace logs.
func DetectTraceEnv ¶
func DetectTraceEnv() bool
DetectTraceEnv detects if the DEBUG environment variable is set to trace.
func SetLevel ¶
SetLevel sets the log level for the logger. If the requested level is TraceLevel, it will enable trace logs and set the level to TraceLevel.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.