WithAttrs returns a new BatchHandler loaded with the specified attributes.
(attrs []slog.Attr)
| 112 | |
| 113 | // WithAttrs returns a new BatchHandler loaded with the specified attributes. |
| 114 | func (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. |
no outgoing calls