Documentation ¶
Overview ¶
Package logger is an adaptation wrapper that simplifies logging in the main code whilst also allowing a pluggable test logger.
Index ¶
- Variables
- func Create(logFile string, opts *slog.HandlerOptions)
- func Debug(msg string, args ...any)
- func Error(msg string, args ...any)
- func Errorf(msg string, args ...any)
- func HttpLogConfig() sloghttp.Config
- func Info(msg string, args ...any)
- func Log(level slog.Level, msg string, args ...any)
- func Warn(msg string, args ...any)
Constants ¶
This section is empty.
Variables ¶
View Source
var Exit = func(code int) { os.Exit(code + int(errorCount.Load())) }
View Source
var Logger = slog.Default()
Logger is a global logger that is able to handle concurrent logging safely.
Functions ¶
func Create ¶
func Create(logFile string, opts *slog.HandlerOptions)
Create updates Logger to use a specific log file (or stdout), based on a specified log file name.
func HttpLogConfig ¶
HttpLogConfig provides configuration options for the HTTP logger, if used.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.