Skip to content

Commit eb9347f

Browse files
authored
promlog: check the log level first (#322)
Signed-off-by: royeo <[email protected]>
1 parent fe057a9 commit eb9347f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: promlog/log.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ func New(config *Config) log.Logger {
118118
l = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr))
119119
}
120120

121+
l = log.With(l, "ts", timestampFormat, "caller", log.DefaultCaller)
122+
121123
if config.Level != nil {
122124
l = level.NewFilter(l, config.Level.o)
123125
}
124-
l = log.With(l, "ts", timestampFormat, "caller", log.DefaultCaller)
125126
return l
126127
}
127128

0 commit comments

Comments
 (0)