mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 22:00:49 +00:00
Merge pull request #779 from francoishill/patch-17
Print error if occurred in WriteMsg
This commit is contained in:
commit
e51a9d6481
10
logs/log.go
10
logs/log.go
@ -193,7 +193,10 @@ func (bl *BeeLogger) startLogger() {
|
||||
select {
|
||||
case bm := <-bl.msg:
|
||||
for _, l := range bl.outputs {
|
||||
l.WriteMsg(bm.msg, bm.level)
|
||||
err := l.WriteMsg(bm.msg, bm.level)
|
||||
if err != nil {
|
||||
fmt.Println("ERROR, unable to WriteMsg:", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -281,7 +284,10 @@ func (bl *BeeLogger) Close() {
|
||||
if len(bl.msg) > 0 {
|
||||
bm := <-bl.msg
|
||||
for _, l := range bl.outputs {
|
||||
l.WriteMsg(bm.msg, bm.level)
|
||||
err := l.WriteMsg(bm.msg, bm.level)
|
||||
if err != nil {
|
||||
fmt.Println("ERROR, unable to WriteMsg (while closing logger):", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user