Improve logging of presence sending failures

This commit is contained in:
bodqhrohro 2019-12-09 02:57:49 +02:00
parent 503e3e0b62
commit ae2470dcb7

View file

@ -2,7 +2,6 @@ package gateway
import ( import (
"encoding/xml" "encoding/xml"
"github.com/pkg/errors"
"dev.narayana.im/narayana/telegabber/xmpp/extensions" "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 // LogBadPresence verbosely logs a presence
func LogBadPresence(err error, presence *stanza.Presence) { func LogBadPresence(err error, presence *stanza.Presence) {
log.WithFields(log.Fields{ log.Errorf("Couldn't send presence: %v: %#v", err, presence)
"presence": *presence,
}).Error(errors.Wrap(err, "Couldn't send presence"))
} }
// SPFrom is a Telegram user id // SPFrom is a Telegram user id