1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 09:00:55 +00:00

Print error if occurred in WriteMsg

This commit is contained in:
Francois 2014-08-26 06:37:35 +02:00
parent a3888cef7f
commit 1d1ad69954

View File

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