1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 22:40:49 +00:00

logger changed

This commit is contained in:
JessonChan 2016-03-25 15:13:28 +08:00
parent 826f81f479
commit 45f2390128

View File

@ -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{} {