Skip to content

Commit 8de85c2

Browse files
authored
Merge pull request #739 from prometheus/beorn7/log
promslog: Use the default timezone (again)
2 parents 318ef65 + 31ee791 commit 8de85c2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

promslog/slog.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ func defaultReplaceAttr(_ []string, a slog.Attr) slog.Attr {
200200
key := a.Key
201201
switch key {
202202
case slog.TimeKey:
203-
if t, ok := a.Value.Any().(time.Time); ok {
204-
a.Value = slog.TimeValue(t.UTC())
205-
} else {
203+
// Note that we do not change the timezone to UTC anymore.
204+
if _, ok := a.Value.Any().(time.Time); !ok {
206205
// If we can't cast the any from the value to a
207206
// time.Time, it means the caller logged
208207
// another attribute with a key of `time`.

0 commit comments

Comments
 (0)