Documentation
¶
Index ¶
Constants ¶
View Source
const LogAttrsKey ctxKey = "log_attrs"
LogAttrsKey is the context key for storing log attributes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextHandler ¶
ContextHandler is a slog.Handler that extracts attributes from context.
func NewContextHandler ¶
func NewContextHandler(h slog.Handler) *ContextHandler
NewContextHandler creates a new ContextHandler wrapping the given handler.
func (*ContextHandler) Handle ¶
Handle extracts attributes from context and adds them to the log record.
Click to show internal directories.
Click to hide internal directories.