-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Description
RuntimeInfo.CallDepth is documented as:
// CallDepth is the number of call frames the logr library adds between the
// end-user and the LogSink. LogSink implementations which choose to print
// the original logging site (e.g. file & line) should climb this many
// additional frames to find it.
It's 1, which is correct for the LogSink.Info and LogSink.Error calls, e.g.
Line 278 in eea184c
| l.sink.Info(l.level, msg, keysAndValues...) |
But it is not correct for the LogSink.Enabled call in Logger.Info:
Line 274 in eea184c
| if l.Enabled() { |
There the call chain is <user code> -> Logger.Info -> Logger.Enabled -> LogSink.Enabled.
It is correct again for <user code> -> Logger.Enabled -> LogSink.Enabled.
Reactions are currently unavailable