Closed jemygraw closed 5 months ago
cc @rogerogers
refer to https://github.com/cloudwego/hertz-examples/blob/main/hlog/logrus/main.go#L105 and because of the additional layer of encapsulation, the line numbers of logrus have changed and require additional configuration.
Describe the bug
I want the logger to print the file path and line number where it is called to track problems. But the current output file path and line number is the logger files in which the logger functions are defined.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
print the file path and line number of the file in which
hlog.Debugf
is called.Screenshots
The current output which is not what I expected.
Way to fix I think we should not wrap the logger in a new function in this file.
https://github.com/cloudwego/hertz/blob/develop/pkg/common/hlog/default.go#L28
They should be defined like this.