From 45f239012855c4b363dc07ab929ad021dfd97db7 Mon Sep 17 00:00:00 2001 From: JessonChan Date: Fri, 25 Mar 2016 15:13:28 +0800 Subject: [PATCH] logger changed --- logs/log.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/logs/log.go b/logs/log.go index 11d54ef8..107c3b20 100644 --- a/logs/log.go +++ b/logs/log.go @@ -143,8 +143,8 @@ func NewLogger(channelLens ...int64) *BeeLogger { bl.level = LevelDebug bl.loggerFuncCallDepth = 2 bl.msgChanLen = append(channelLens, 0)[0] - if bl.msgChanLen < 0 { - bl.msgChanLen = 0 + if bl.msgChanLen <= 0 { + bl.msgChanLen = defaultAsyncMsgLen } bl.signalChan = make(chan string, 1) bl.setLogger(AdapterConsole) @@ -159,9 +159,6 @@ func (bl *BeeLogger) Async() *BeeLogger { return bl } bl.asynchronous = true - if bl.msgChanLen <= 0 { - bl.msgChanLen = defaultAsyncMsgLen - } bl.msgChan = make(chan *logMsg, bl.msgChanLen) logMsgPool = &sync.Pool{ New: func() interface{} {