Documentation
¶
Overview ¶
Package log is meant to provide a global logger for the application and provide logging functionality interface.
Index ¶
- func Debug(format string, v ...any)
- func DebugTimer(name string) func()
- func Err(format string, v ...any)
- func Fatal(format string, v ...any)
- func Info(format string, v ...any)
- func Panic(format string, v ...any)
- func SetGlobalLogger(newL Logger)
- func SetLevel(lvl Level)
- func Warn(format string, v ...any)
- type Config
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugTimer ¶ added in v0.14.0
func DebugTimer(name string) func()
DebugTimer returns a function that prints the name argument and the elapsed time between the call to timer and the call to the returned function. The returned function is intended to be used in a defer statement:
defer DebugTimer("sum")().
func SetGlobalLogger ¶
func SetGlobalLogger(newL Logger)
SetGlobalLogger sets a package default global logger.
Types ¶
type Logger ¶
type Logger interface {
Debug(format string, v ...any)
Info(format string, v ...any)
Warn(format string, v ...any)
Err(format string, v ...any)
Panic(format string, v ...any)
Fatal(format string, v ...any)
SetLevel(Level)
}
Logger interface defines leveled logging functionality.
func NewNoopLogger ¶
func NewNoopLogger() Logger
NewNoopLogger creates a new logger that doesn't do anything.
Click to show internal directories.
Click to hide internal directories.