From 6a047f87229c277b72a1a54b18dc39abe1dbdca4 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 26 Jan 2018 21:54:09 +0100 Subject: [PATCH] Print only debug messages when specified (xmpp). Closes #345 --- bridge/config/config.go | 1 + bridge/xmpp/xmpp.go | 2 +- matterbridge.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bridge/config/config.go b/bridge/config/config.go index 13b7a8d0..af3bf036 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -53,6 +53,7 @@ type Protocol struct { BindAddress string // mattermost, slack // DEPRECATED Buffer int // api Charset string // irc + Debug bool // general EditSuffix string // mattermost, slack, discord, telegram, gitter EditDisable bool // mattermost, slack, discord, telegram, gitter IconURL string // mattermost, slack diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index 0ad7699c..63a1048e 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -110,7 +110,7 @@ func (b *Bxmpp) createXMPP() (*xmpp.Client, error) { TLSConfig: tc, //StartTLS: false, - Debug: true, + Debug: b.General.Debug, Session: true, Status: "", StatusMessage: "", diff --git a/matterbridge.go b/matterbridge.go index 397497cf..e755ea72 100644 --- a/matterbridge.go +++ b/matterbridge.go @@ -43,6 +43,7 @@ func main() { log.Println("WARNING: THIS IS A DEVELOPMENT VERSION. Things may break.") } cfg := config.NewConfig(*flagConfig) + cfg.General.Debug = *flagDebug r, err := gateway.NewRouter(cfg) if err != nil { log.Fatalf("Starting gateway failed: %s", err)