(ctx context.Context, r slog.Record)
| 73 | } |
| 74 | |
| 75 | func (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 | |
| 93 | func (m *SlogMultiHandler) WithAttrs(attrs []slog.Attr) slog.Handler { |
| 94 | hs := make([]slog.Handler, len(m.Handlers)) |
no outgoing calls
no test coverage detected