1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 20:00:55 +00:00

no need to call Sprintf when no args

This commit is contained in:
JessonChan 2016-03-24 20:22:42 +08:00
parent 06299fa47b
commit f02ff0420d

View File

@ -256,7 +256,9 @@ func (bl *BeeLogger) writeMsg(logLevel int, msg string, v ...interface{}) error
} else {
msg = levelPrefix[logLevel] + msg
}
msg = fmt.Sprintf(msg, v...)
if len(v) > 0 {
msg = fmt.Sprintf(msg, v...)
}
when := time.Now()
if bl.enableFuncCallDepth {
_, file, line, ok := runtime.Caller(bl.loggerFuncCallDepth)