Documentation ¶
Overview ¶
nolint
Index ¶
Constants ¶
View Source
const ( LevelAll = "all" LevelDebug = "debug" LevelInfo = "info" LevelWarn = "warn" LevelError = "error" LevelNone = "none" )
View Source
const ( FormatLogFmt = "logfmt" FormatJSON = "json" )
Variables ¶
View Source
var AvailableLogFormats = []string{ FormatLogFmt, FormatJSON, }
AvailableLogFormats is a list of supported log formats
View Source
var AvailableLogLevels = []string{ LevelAll, LevelDebug, LevelInfo, LevelWarn, LevelError, LevelNone, }
AvailableLogLevels is a list of supported logging levels
Functions ¶
func NewLogger ¶
NewLogger returns a log.Logger that prints in the provided format at the provided level with a UTC timestamp and the caller of the log entry.
func NewLoggerSlog ¶
NewLoggerSlog returns a *slog.Logger that prints in the provided format at the provided level with a UTC timestamp and the caller of the log entry.
func RegisterFlags ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.