MCPcopy Create free account
hub / github.com/cloudbase/garm / Handle

Method Handle

util/logging.go:75–91  ·  view source on GitHub ↗
(ctx context.Context, r slog.Record)

Source from the content-addressed store, hash-verified

73}
74
75func (m *SlogMultiHandler) Handle(ctx context.Context, r slog.Record) error {
76 record := r.Clone()
77 attrs, ok := ctx.Value(slogCtxFields).([]slog.Attr)
78 if ok {
79 for _, v := range attrs {
80 record.AddAttrs(v)
81 }
82 }
83
84 var firstErr error
85 for _, h := range m.Handlers {
86 if err := h.Handle(ctx, record); err != nil && firstErr == nil {
87 firstErr = err
88 }
89 }
90 return firstErr
91}
92
93func (m *SlogMultiHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
94 hs := make([]slog.Handler, len(m.Handlers))

Callers 3

WithMetricsRouterFunction · 0.80
WithAgentRouterFunction · 0.80
NewAPIRouterFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected