MCPcopy Create free account
hub / github.com/bytebase/bytebase / NewContextHandler

Function NewContextHandler

backend/common/log/context.go:49–51  ·  view source on GitHub ↗

NewContextHandler wraps a slog handler so records include attributes carried by context.

(handler slog.Handler)

Source from the content-addressed store, hash-verified

47
48// NewContextHandler wraps a slog handler so records include attributes carried by context.
49func NewContextHandler(handler slog.Handler) slog.Handler {
50 return &contextHandler{handler: handler}
51}
52
53func (h *contextHandler) Enabled(ctx context.Context, level slog.Level) bool {
54 return h.handler.Enabled(ctx, level)

Calls

no outgoing calls