From dfa9e0398077601b70e388edb670a5ffa369f43f Mon Sep 17 00:00:00 2001 From: yuanxuan Date: Sun, 9 Oct 2016 15:19:21 +0800 Subject: [PATCH] fix log func call depth bug --- logs/log.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/logs/log.go b/logs/log.go index 3d512d2e..806ebaa0 100644 --- a/logs/log.go +++ b/logs/log.go @@ -380,7 +380,10 @@ func (bl *BeeLogger) Error(format string, v ...interface{}) { // Warning Log WARNING level message. 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. @@ -393,7 +396,10 @@ func (bl *BeeLogger) Notice(format string, v ...interface{}) { // Informational Log INFORMATIONAL level message. 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. @@ -425,7 +431,10 @@ func (bl *BeeLogger) Info(format string, v ...interface{}) { // Trace Log TRACE level message. // compatibility alias for Debug() 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.