XMPP debug output

This commit is contained in:
Martin/Geno 2019-06-06 21:20:51 +02:00
parent aceced844a
commit 5f09a187ce
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
6 changed files with 6 additions and 6 deletions

View File

@ -9,7 +9,7 @@ type Config struct {
Host string
Connection string
Secret string
XMPPLog bool `toml:"xmpp_log"`
XMPPDebug bool `toml:"xmpp_debug"`
Special map[string]interface{}
xmpp *xmpp.Component

View File

@ -91,7 +91,7 @@ func (c *Config) receiving(packet xmpp.Packet) (xmpp.Packet, bool) {
}
case xmpp.Message:
if c.XMPPLog {
if c.XMPPDebug {
logger.WithFields(map[string]interface{}{
"from": p.PacketAttrs.From,
"to": p.PacketAttrs.To,

View File

@ -10,7 +10,7 @@ import (
func TestReceive(t *testing.T) {
assert := assert.New(t)
c := Config{Host: "example.org", Type: "monkeyservice"}
c := Config{Host: "example.org", Type: "monkeyservice", XMPPDebug: true}
// ignoring packet
p, _ := c.receiving(xmpp.Handshake{})

View File

@ -22,7 +22,7 @@ func (c *Config) sending(packet xmpp.Packet) xmpp.Packet {
} else {
p.PacketAttrs.From += "@" + c.Host
}
if c.XMPPLog {
if c.XMPPDebug {
logger.WithFields(map[string]interface{}{
"from": p.PacketAttrs.From,
"to": p.PacketAttrs.To,

View File

@ -10,7 +10,7 @@ import (
func TestSend(t *testing.T) {
assert := assert.New(t)
c := Config{Host: "example.org"}
c := Config{Host: "example.org", XMPPDebug: true}
// ignoring packet
p := c.sending(xmpp.IQ{})

View File

@ -5,7 +5,7 @@ type = "threema"
host = "threema.chat.sum7.eu"
connection = "localhost:5347"
secret = "change_me"
xmpp_log = false
xmpp_debug = false
[component.special]
http_upload_url = "https://example.org/upload/threema"