Commit 71149218 authored by astaxie's avatar astaxie

fix the log level

parent 1636a727
......@@ -277,6 +277,7 @@ func init() {
if err != nil {
fmt.Println("init console log error:", err)
}
BeeLogger.SetLogFuncCallDepth(true)
err = ParseConfig()
if err != nil && !os.IsNotExist(err) {
......
......@@ -154,7 +154,10 @@ func (bl *BeeLogger) writerMsg(loglevel int, msg string) error {
lm := new(logMsg)
lm.level = loglevel
if bl.enableFuncCallDepth {
_, file, line, ok := runtime.Caller(bl.loggerFuncCallDepth)
_, file, line, ok := runtime.Caller(bl.loggerFuncCallDepth + 1)
if !ok {
_, file, line, ok = runtime.Caller(bl.loggerFuncCallDepth)
}
if ok {
_, filename := path.Split(file)
lm.msg = fmt.Sprintf("[%s:%d] %s", filename, line, msg)
......
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