|
|
|
@ -89,9 +89,13 @@ func (wl *WrappedSlogger) Trace(msg string, fields watermill.LogFields) {
|
|
|
|
|
|
|
|
|
|
func (wl *WrappedSlogger) With(fields watermill.LogFields) watermill.LoggerAdapter {
|
|
|
|
|
attrs := LogFieldsToSlogAttrs(fields)
|
|
|
|
|
loggerArgs := make([]any, len(attrs))
|
|
|
|
|
for idx, attr := range attrs {
|
|
|
|
|
loggerArgs[idx] = attr
|
|
|
|
|
}
|
|
|
|
|
newLoggers := make([]*slog.Logger, 0)
|
|
|
|
|
for _, l := range wl.loggers {
|
|
|
|
|
newLoggers = append(newLoggers, l.With(attrs))
|
|
|
|
|
newLoggers = append(newLoggers, l.With(loggerArgs...))
|
|
|
|
|
}
|
|
|
|
|
return &WrappedSlogger{loggers: newLoggers}
|
|
|
|
|
|
|
|
|
|