1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 22:50:50 +00:00

if read the log.go then calldepth add 1

This commit is contained in:
astaxie 2014-11-03 16:43:07 +08:00
parent 304beaf89f
commit 88caf1ed70

View File

@ -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)