Documentation
¶
Index ¶
Constants ¶
View Source
const ( ArgLevel = "logger.level" ArgFormat = "logger.format" )
View Source
const (
RequestIDContextKey contextKey = 0
)
Variables ¶
View Source
var Noop slog.Handler = noopHandler{}
Noop is a Handler which is always disabled and therefore logs nothing.
Functions ¶
func NoopLogger ¶
NoopLogger returns a new slog.Logger that logs nothing.
Types ¶
type Format ¶
type Format int
Format determines what kind of output is written by the logger.
func (*Format) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Handler ¶
Handler is a struct that embeds slog.Handler to provide additional functionality or customization for handling logs in the application. This Handler enables request ID functionality by adding a request_id to the log records if available in the context.
func NewLogHandler ¶
Click to show internal directories.
Click to hide internal directories.