bytedance / gopkg

Universal Utilities for Go
Apache License 2.0
1.71k stars 224 forks source link

logger 中default 的 calldepth = 3 会导致输出Log 无法定位实际输出 #189

Open chenxiang105 opened 1 year ago

chenxiang105 commented 1 year ago

Operating System

mac

Go Version

go version go1.21.0 darwin/arm64

Package Version

latest

Affected Packages

gopkg/util/logger

Expected Behavior

img_v2_6b2e0014-ce7d-418c-8e63-00a90481167g 预期输出实际的logger.CtxInfo 代码所在行数,参考截图中的差异

Actual Behavior

参考截图

Reproduction Steps

gopkg/util/logger/default.go 55行:ll.logger.Output(3, msg)

issue 描述: 第一个参数calldepth 写死了3,输出log永远都是 "logger.go 55 ***"

期望Fix: 支持customized or default value = 4

Other Information

No response