diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-27 10:35:09 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-27 10:35:09 +0100 |
commit | 19975e981ed0f1fbd96644d95ede5435bfbdccfc (patch) | |
tree | 02c0b5df7583f212de9dfe9dbebff1e6fc8160fd /connector | |
parent | 6bbf08af8f8acc93d6aed721f56d70c8aca75ed4 (diff) | |
download | easybridge-19975e981ed0f1fbd96644d95ede5435bfbdccfc.tar.gz easybridge-19975e981ed0f1fbd96644d95ede5435bfbdccfc.zip |
Logging done better
Diffstat (limited to 'connector')
-rw-r--r-- | connector/mattermost/mattermost.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/connector/mattermost/mattermost.go b/connector/mattermost/mattermost.go index e3a6429..530938c 100644 --- a/connector/mattermost/mattermost.go +++ b/connector/mattermost/mattermost.go @@ -109,8 +109,6 @@ func (mm *Mattermost) Configure(c Configuration) error { go mm.conn.WsReceiver() go mm.conn.StatusLoop() - fmt.Printf("CLIENT4: %#v\n", mm.conn.Client) - for i := 0; i < 42; i++ { time.Sleep(time.Duration(1) * time.Second) if mm.conn.WsConnected { @@ -166,7 +164,6 @@ func (mm *Mattermost) reverseRoomId(id string) (bool, RoomID) { teamName := mm.conn.GetTeamName(team) if u, ok := mm.teams[teamName]; ok && u { name := mm.conn.GetChannelName(id) - fmt.Printf("CHANNEL NAME: %s TEAM: %s\n", name, teamName) return true, RoomID(fmt.Sprintf("%s@%s@%s", name, teamName, mm.server)) } else { return false, "" @@ -329,7 +326,7 @@ func (mm *Mattermost) handleConnected() { mm.caches.sentjoined = make(map[string]bool) mm.caches.displayname = make(map[UserID]string) - fmt.Printf("Connected to mattermost\n") + log.Debugf("Connected to mattermost: %s@%s\n", mm.username, mm.server) // Handle incoming messages go mm.handleLoop(mm.conn.MessageChan, mm.handlerStopChan) @@ -468,8 +465,8 @@ func (mm *Mattermost) handleLoop(msgCh chan *matterclient.Message, quitCh chan b case <-quitCh: break case msg := <-msgCh: - fmt.Printf("Mattermost: %#v\n", msg) - fmt.Printf("Mattermost raw: %#v\n", msg.Raw) + log.Tracef("Mattermost: %#v\n", msg) + log.Tracef("Mattermost raw: %#v\n", msg.Raw) err := mm.handlePosted(msg.Raw) if err != nil { log.Warnf("Mattermost error: %s", err) |