From ae2470dcb70c302bd3fbcd53ffa7384f526435bd Mon Sep 17 00:00:00 2001 From: bodqhrohro Date: Mon, 9 Dec 2019 02:57:49 +0200 Subject: [PATCH] Improve logging of presence sending failures --- xmpp/gateway/gateway.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/xmpp/gateway/gateway.go b/xmpp/gateway/gateway.go index be1f6a3..8629698 100644 --- a/xmpp/gateway/gateway.go +++ b/xmpp/gateway/gateway.go @@ -2,7 +2,6 @@ package gateway import ( "encoding/xml" - "github.com/pkg/errors" "dev.narayana.im/narayana/telegabber/xmpp/extensions" @@ -61,9 +60,7 @@ func SendMessage(to string, from string, body string, component *xmpp.Component) // LogBadPresence verbosely logs a presence func LogBadPresence(err error, presence *stanza.Presence) { - log.WithFields(log.Fields{ - "presence": *presence, - }).Error(errors.Wrap(err, "Couldn't send presence")) + log.Errorf("Couldn't send presence: %v: %#v", err, presence) } // SPFrom is a Telegram user id