MCPcopy Index your code
hub / github.com/pocketbase/pocketbase / WithAttrs

Method WithAttrs

tools/logger/batch_handler.go:114–125  ·  view source on GitHub ↗

WithAttrs returns a new BatchHandler loaded with the specified attributes.

(attrs []slog.Attr)

Source from the content-addressed store, hash-verified

112
113// WithAttrs returns a new BatchHandler loaded with the specified attributes.
114func (h *BatchHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
115 if len(attrs) == 0 {
116 return h
117 }
118
119 return &BatchHandler{
120 parent: h,
121 mux: h.mux,
122 options: h.options,
123 attrs: attrs,
124 }
125}
126
127// Handle formats the slog.Record argument as JSON object and adds it
128// to the batch queue.

Calls

no outgoing calls

Tested by 2