outposts: cleanup logging

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-12 18:01:46 +02:00
parent 52cf4890cf
commit 34ab68a169
1 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ func (ac *APIController) startWSHandler() {
var wsMsg websocketMessage var wsMsg websocketMessage
err := ac.wsConn.ReadJSON(&wsMsg) err := ac.wsConn.ReadJSON(&wsMsg)
if err != nil { if err != nil {
logger.Println("read:", err) logger.WithError(err).Warning("ws write error, reconnecting")
ac.wsConn.CloseAndReconnect() ac.wsConn.CloseAndReconnect()
continue continue
} }
@ -107,7 +107,7 @@ func (ac *APIController) startWSHealth() {
err := ac.wsConn.WriteJSON(aliveMsg) err := ac.wsConn.WriteJSON(aliveMsg)
ac.logger.WithField("loop", "ws-health").Trace("hello'd") ac.logger.WithField("loop", "ws-health").Trace("hello'd")
if err != nil { if err != nil {
ac.logger.WithField("loop", "ws-health").Println("write:", err) ac.logger.WithField("loop", "ws-health").WithError(err).Warning("ws write error, reconnecting")
ac.wsConn.CloseAndReconnect() ac.wsConn.CloseAndReconnect()
continue continue
} }