Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Fix log location reporting
Browse files Browse the repository at this point in the history
We add a level of indirection before calling Log(), so we need an
to report the location a level higher in the callstack than the default.
  • Loading branch information
JLockerman committed Oct 1, 2020
1 parent 3b39662 commit 9bec5c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func Init(cfg Config) error {
}

l = level.NewFilter(l, logLevelOption)
logger = log.With(l, "ts", timestampFormat, "caller", log.DefaultCaller)
// NOTE: we add a level of indirection with our logging functions,
// so we need additional caller depth
logger = log.With(l, "ts", timestampFormat, "caller", log.Caller(4))
return nil
}

Expand Down

0 comments on commit 9bec5c8

Please sign in to comment.