From 1d1ad69954f3379966165e36cecd9167a4a50589 Mon Sep 17 00:00:00 2001 From: Francois Date: Tue, 26 Aug 2014 06:37:35 +0200 Subject: [PATCH] Print error if occurred in WriteMsg --- logs/log.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/logs/log.go b/logs/log.go index 4349e8a5..3315f946 100644 --- a/logs/log.go +++ b/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