Commit 2f6fc3f6 authored by astaxie's avatar astaxie Committed by GitHub

Merge pull request #2213 from axyu/develop

fix log func call depth bug
parents 84310b16 dfa9e039
...@@ -380,7 +380,10 @@ func (bl *BeeLogger) Error(format string, v ...interface{}) { ...@@ -380,7 +380,10 @@ func (bl *BeeLogger) Error(format string, v ...interface{}) {
// Warning Log WARNING level message. // Warning Log WARNING level message.
func (bl *BeeLogger) Warning(format string, v ...interface{}) { func (bl *BeeLogger) Warning(format string, v ...interface{}) {
bl.Warn(format, v...) if LevelWarn > bl.level {
return
}
bl.writeMsg(LevelWarn, format, v...)
} }
// Notice Log NOTICE level message. // Notice Log NOTICE level message.
...@@ -393,7 +396,10 @@ func (bl *BeeLogger) Notice(format string, v ...interface{}) { ...@@ -393,7 +396,10 @@ func (bl *BeeLogger) Notice(format string, v ...interface{}) {
// Informational Log INFORMATIONAL level message. // Informational Log INFORMATIONAL level message.
func (bl *BeeLogger) Informational(format string, v ...interface{}) { func (bl *BeeLogger) Informational(format string, v ...interface{}) {
bl.Info(format, v...) if LevelInfo > bl.level {
return
}
bl.writeMsg(LevelInfo, format, v...)
} }
// Debug Log DEBUG level message. // Debug Log DEBUG level message.
...@@ -425,7 +431,10 @@ func (bl *BeeLogger) Info(format string, v ...interface{}) { ...@@ -425,7 +431,10 @@ func (bl *BeeLogger) Info(format string, v ...interface{}) {
// Trace Log TRACE level message. // Trace Log TRACE level message.
// compatibility alias for Debug() // compatibility alias for Debug()
func (bl *BeeLogger) Trace(format string, v ...interface{}) { func (bl *BeeLogger) Trace(format string, v ...interface{}) {
bl.Debug(format, v...) if LevelDebug > bl.level {
return
}
bl.writeMsg(LevelDebug, format, v...)
} }
// Flush flush all chan data. // Flush flush all chan data.
......
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