From d960dc8fa741fc591921084319d01a411b1e11b4 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Tue, 14 Nov 2023 21:57:33 +0800 Subject: [PATCH] express built-in time key as String attribute instead of Any --- log/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log/handler.go b/log/handler.go index 243777ca29..47bfbdb4f6 100644 --- a/log/handler.go +++ b/log/handler.go @@ -177,7 +177,7 @@ func builtinReplace(_ []string, attr slog.Attr) slog.Attr { switch attr.Key { case slog.TimeKey: if attr.Value.Kind() == slog.KindTime { - return slog.Any("t", attr.Value.Time().Format(timeFormat)) + return slog.String("t", attr.Value.Time().Format(timeFormat)) } case slog.LevelKey: if l, ok := attr.Value.Any().(slog.Level); ok {