From 88caf1ed70b7f5afb9a56128154e7bf5407420f1 Mon Sep 17 00:00:00 2001 From: astaxie Date: Mon, 3 Nov 2014 16:43:07 +0800 Subject: [PATCH] if read the log.go then calldepth add 1 --- logs/log.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/logs/log.go b/logs/log.go index 341df572..a1964892 100644 --- a/logs/log.go +++ b/logs/log.go @@ -155,6 +155,9 @@ func (bl *BeeLogger) writerMsg(loglevel int, msg string) error { lm.level = loglevel if bl.enableFuncCallDepth { _, file, line, ok := runtime.Caller(bl.loggerFuncCallDepth) + if file == "log.go" && line == 97 { + _, file, line, ok := runtime.Caller(bl.loggerFuncCallDepth + 1) + } if ok { _, filename := path.Split(file) lm.msg = fmt.Sprintf("[%s:%d] %s", filename, line, msg)