File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,10 @@ import (
5353// - slog.SourceKey: skipped
5454// - slog.MessageKey: ignores changes to the key name. If the returned value is empty, the message will
5555// be set to the value `<nil>`. Non-string values are coerced to a string like `fmt.Print`
56- // - slog.TimeKey: ignores changes to the key name. If the value returned is not empty or a time.Time{}, it is
57- // ignored.
58- // - slog.LevelKey: ignores changes to the key name. If the value returned is not empty or a slog.Level, it is
59- // ignored.
56+ // - slog.TimeKey: ignores changes to the key name. The slog.Value returned must either be empty, or
57+ // a slog.KindTime. Other values will be ignored.
58+ // - slog.LevelKey: ignores changes to the key name. The slog.Value returned must either be empty, or
59+ // be a slog.KindAny containing a slog.Level value. Other values will be ignored.
6060//
6161// The middleware may be further configured to skip processing built-in attributes, or skipping processing
6262// for particular records.
@@ -168,7 +168,7 @@ func (r *ReplaceAttrsMiddleware) applyToLevel(l slog.Level) slog.Level {
168168 if attr .Value .Equal (slog.Value {}) {
169169 return slog .LevelInfo
170170 }
171- if attr .Value .Kind () == slog .KindAny && attr . Key == slog . LevelKey {
171+ if attr .Value .Kind () == slog .KindAny {
172172 if lvl , ok := attr .Value .Any ().(slog.Level ); ok {
173173 return lvl
174174 }
You can’t perform that action at this time.
0 commit comments