if read the log.go then calldepth add 1
Showing
1 changed file
with
3 additions
and
0 deletions
| ... | @@ -155,6 +155,9 @@ func (bl *BeeLogger) writerMsg(loglevel int, msg string) error { | ... | @@ -155,6 +155,9 @@ func (bl *BeeLogger) writerMsg(loglevel int, msg string) error { |
| 155 | lm.level = loglevel | 155 | lm.level = loglevel |
| 156 | if bl.enableFuncCallDepth { | 156 | if bl.enableFuncCallDepth { |
| 157 | _, file, line, ok := runtime.Caller(bl.loggerFuncCallDepth) | 157 | _, file, line, ok := runtime.Caller(bl.loggerFuncCallDepth) |
| 158 | if file == "log.go" && line == 97 { | ||
| 159 | _, file, line, ok := runtime.Caller(bl.loggerFuncCallDepth + 1) | ||
| 160 | } | ||
| 158 | if ok { | 161 | if ok { |
| 159 | _, filename := path.Split(file) | 162 | _, filename := path.Split(file) |
| 160 | lm.msg = fmt.Sprintf("[%s:%d] %s", filename, line, msg) | 163 | lm.msg = fmt.Sprintf("[%s:%d] %s", filename, line, msg) | ... | ... |
-
Please register or sign in to post a comment