e51a9d64 by astaxie

Merge pull request #779 from francoishill/patch-17

Print error if occurred in WriteMsg
2 parents e9a1daa3 1d1ad699
...@@ -193,7 +193,10 @@ func (bl *BeeLogger) startLogger() { ...@@ -193,7 +193,10 @@ func (bl *BeeLogger) startLogger() {
193 select { 193 select {
194 case bm := <-bl.msg: 194 case bm := <-bl.msg:
195 for _, l := range bl.outputs { 195 for _, l := range bl.outputs {
196 l.WriteMsg(bm.msg, bm.level) 196 err := l.WriteMsg(bm.msg, bm.level)
197 if err != nil {
198 fmt.Println("ERROR, unable to WriteMsg:", err)
199 }
197 } 200 }
198 } 201 }
199 } 202 }
...@@ -281,7 +284,10 @@ func (bl *BeeLogger) Close() { ...@@ -281,7 +284,10 @@ func (bl *BeeLogger) Close() {
281 if len(bl.msg) > 0 { 284 if len(bl.msg) > 0 {
282 bm := <-bl.msg 285 bm := <-bl.msg
283 for _, l := range bl.outputs { 286 for _, l := range bl.outputs {
284 l.WriteMsg(bm.msg, bm.level) 287 err := l.WriteMsg(bm.msg, bm.level)
288 if err != nil {
289 fmt.Println("ERROR, unable to WriteMsg (while closing logger):", err)
290 }
285 } 291 }
286 } else { 292 } else {
287 break 293 break
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!