Commit f02ff042 authored by JessonChan's avatar JessonChan

no need to call Sprintf when no args

parent 06299fa4
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment