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
Is your feature request related to a problem? Please describe.
en
At present, it is difficult for us to directly use hlog in business scenarios.
First of all it is a public instance, any settings will take effect globally (not only business code, but also hertz).
Secondly as the documentation says hlog it is difficult to encapsulate. This caused me to reimplement FullLogger even if I only needed a simple wrapper.
li-jin-gou
changed the title
Proposal: Support New and SetCallerSkip func for hlog
✨ Proposal: Support New and SetCallerSkip func for hlog
Sep 15, 2022
Is your feature request related to a problem? Please describe.
en
At present, it is difficult for us to directly use hlog in business scenarios.
First of all it is a public instance, any settings will take effect globally (not only business code, but also hertz).
Secondly as the documentation says hlog it is difficult to encapsulate. This caused me to reimplement FullLogger even if I only needed a simple wrapper.
zh
目前我们很难在业务场景中直接使用
hlog
。首先它是一个公共的实例,任何设置都将导致全局生效,(不仅在业务日志中生效,也包含hertz源码日志也生效)。
其次正如文档说的那样封装
hlog
可能会导致日志内容里文件名和行数不准确。这导致了即便我只需要简单封装,我也要重新实现FullLogger
。Describe the solution you'd like
en
Add a
New
func to create a differentdefaultLogger
instance, add aSetCallerSkip
func to specify the caller depth.zh
增加一个
New
方法去创建不同的defaultLogger
实例,增加SetCallerSkip
方法去指定调用位置。The text was updated successfully, but these errors were encountered: