[TASK] improve closing on log client
This commit is contained in:
parent
5f74be54e6
commit
9aa520b8f8
|
@ -46,8 +46,8 @@ func (l *Logger) Hook(e *log.Entry) {
|
||||||
}
|
}
|
||||||
err := l.conn.WriteJSON(e)
|
err := l.conn.WriteJSON(e)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("[logmania] could not send log entry:", err)
|
|
||||||
l.Close()
|
l.Close()
|
||||||
|
log.Error("[logmania] could not send log entry:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ func (l *Logger) Listen() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
l.Close()
|
||||||
log.Warn("[logmania] close listener:", err)
|
log.Warn("[logmania] close listener:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue