You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"level":"info","time":"2009-11-10T23:00:00Z","caller":"/tmp/sandbox2691989628/prog.go:10","message":"Should be 10"}
{"level":"info","caller":"/tmp/sandbox2691989628/prog.go:11","time":"2009-11-10T23:00:00Z","caller":"/tmp/sandbox2691989628/prog.go:16","message":"Should be 11"}
{"level":"info","field1":"left","field1":"right","time":"2009-11-10T23:00:00Z","caller":"/tmp/sandbox2691989628/prog.go:12","message":"Test"}
Program exited.
as you can see the second skip set in the UtilSomething funktion is getting put to the right and therefore when collapsing using the wrong line number. Is that a issue in zerolog or a missunderstanding how to use the API for such a case?
The text was updated successfully, but these errors were encountered:
And for clarification: The first .Caller() is set on the root logger to always display caller lines and the second one is used in util functions to get the right line number.
when using the
.Caller
like thissrc: https://go.dev/play/p/nyLsISEzVhV
we are getting this output:
as you can see the second skip set in the
UtilSomething
funktion is getting put to the right and therefore when collapsing using the wrong line number. Is that a issue in zerolog or a missunderstanding how to use the API for such a case?The text was updated successfully, but these errors were encountered: