# Functions
CloseAndLog is a convenient helper to log errors returned by closer.
ContextWithLogger returns a new context with the given logger.
LoggerFromContext returns a logger for this request, if any.
MustLoggerFromContext returns a logger for this request and panics if there is no logger.
New creates a slog logger with the given parameters.
NewAdGuardLegacyHandler creates a new properly initialized *AdGuardLegacyHandler.
NewDiscardLogger returns a new logger that uses [DiscardHandler].
NewFormat returns a new valid format.
NewJSONHybridHandler creates a new properly initialized *JSONHybridHandler.
NewLevelHandler returns a LevelHandler with the given level.
PrintByteLines splits b and logs the lines to l using the given level, including empty lines.
PrintLines splits s and logs the lines to l using the given level, including empty lines.
PrintStack logs the stacktrace into l on the given level.
RecoverAndExit recovers a panic, logs it using l, and then exits with the given exit code.
RecoverAndLog is a deferred helper that recovers from a panic and logs the panic value into l along with the stacktrace.
RecoverAndLogDefault is like [RecoverAndLog] but tries to get the logger from ctx using [LoggerFromContext] and, if there is none, uses [slog.Default].
RemoveTime is a function for [slog.HandlerOptions.ReplaceAttr] that removes the "time" attribute.
ReplaceLevel is a function for [slog.HandlerOptions.ReplaceAttr] that adds [LevelTrace] custom name for level attribute.
VerbosityToLevel returns log level for given verbosity.
# Constants
Valid formats.
Valid formats.
Valid formats.
Valid formats.
Valid formats.
Additional or renamed key constants.
Additional or renamed key constants.
Additional or renamed key constants.
Additional or renamed key constants.
Additional or renamed key constants.
Additional or renamed key constants.
Acceptable [slog.Level] levels.
Acceptable [slog.Level] levels.
Acceptable [slog.Level] levels.
Acceptable [slog.Level] levels.
Acceptable [slog.Level] levels.
# Structs
AdGuardLegacyHandler is a text [slog.Handler] that uses package github.com/AdguardTeam/golibs/log for output.
BadFormatError is an error about a bad logging format.
Config contains the configuration for a logger.
DiscardHandler ignores all messages.
JSONHybridHandler is a hybrid JSON-and-text [slog.Handler] more suitable for stricter environments.
A LevelHandler wraps a Handler with an Enabled method that returns false for levels below a minimum.
# Type aliases
Format represents an acceptable format of logs.