From 5f9ad2948359b9ad69b3bd702288e3a3401fd819 Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Tue, 11 Sep 2018 20:20:58 +0200 Subject: [PATCH] [BUGFIX] init notify with debug --- database/notify.go | 7 ++++--- output/file/main.go | 6 ++++-- output/websocket/main.go | 7 +++++-- output/xmpp/main.go | 7 +++++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/database/notify.go b/database/notify.go index 22fc748..4e772d2 100644 --- a/database/notify.go +++ b/database/notify.go @@ -90,9 +90,10 @@ func (db *DB) NewNotify(to string) *Notify { return nil } n := &Notify{ - Protocol: addr[0], - To: addr[1], - RegexIn: make(map[string]*regexp.Regexp), + Protocol: addr[0], + To: addr[1], + RegexIn: make(map[string]*regexp.Regexp), + MaxPrioIn: log.DebugLevel, } db.AddNotify(n) return n diff --git a/output/file/main.go b/output/file/main.go index 98f687b..48d3d10 100644 --- a/output/file/main.go +++ b/output/file/main.go @@ -46,8 +46,10 @@ func Init(configInterface interface{}, db *database.DB, bot *bot.Bot) output.Out var defaults []*database.Notify if config.Default != "" { defaults = append(defaults, &database.Notify{ - Protocol: proto, - To: config.Default, + Protocol: proto, + To: config.Default, + RegexIn: make(map[string]*regexp.Regexp), + MaxPrioIn: log.DebugLevel, }) } diff --git a/output/websocket/main.go b/output/websocket/main.go index 67a0ac4..8236fcd 100644 --- a/output/websocket/main.go +++ b/output/websocket/main.go @@ -2,6 +2,7 @@ package xmpp import ( "net/http" + "regexp" "dev.sum7.eu/genofire/golang-lib/websocket" "github.com/mitchellh/mapstructure" @@ -57,8 +58,10 @@ func Init(configInterface interface{}, db *database.DB, bot *bot.Bot) output.Out var defaults []*database.Notify if config.Default != "" { defaults = append(defaults, &database.Notify{ - Protocol: proto, - To: config.Default, + Protocol: proto, + To: config.Default, + RegexIn: make(map[string]*regexp.Regexp), + MaxPrioIn: log.DebugLevel, }) } return &Output{ diff --git a/output/xmpp/main.go b/output/xmpp/main.go index fb622d3..eb39ee8 100644 --- a/output/xmpp/main.go +++ b/output/xmpp/main.go @@ -1,6 +1,7 @@ package xmpp import ( + "regexp" "strings" xmpp_client "dev.sum7.eu/genofire/yaja/client" @@ -148,8 +149,10 @@ func Init(configInterface interface{}, db *database.DB, bot *bot.Bot) output.Out for to, muc := range config.Defaults { def := &database.Notify{ - Protocol: proto, - To: to, + Protocol: proto, + To: to, + RegexIn: make(map[string]*regexp.Regexp), + MaxPrioIn: log.DebugLevel, } if muc { def.Protocol = protoGroup