summaryrefslogtreecommitdiffstats
path: root/matterclient/messages.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-02-23 22:51:27 +0100
committerGitHub <noreply@github.com>2019-02-23 22:51:27 +0100
commitbf21604d425b4feb1b95e4e94643e7a658eeea90 (patch)
tree376741188b9646ef66526b36e24d3577f07a678f /matterclient/messages.go
parent1bb39eba8717f62336cc98c5bb7cfbef194f3626 (diff)
downloadmatterbridge-msglm-bf21604d425b4feb1b95e4e94643e7a658eeea90.tar.gz
matterbridge-msglm-bf21604d425b4feb1b95e4e94643e7a658eeea90.tar.bz2
matterbridge-msglm-bf21604d425b4feb1b95e4e94643e7a658eeea90.zip
Make all loggers derive from non-default instance (#728)
Diffstat (limited to 'matterclient/messages.go')
-rw-r--r--matterclient/messages.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/matterclient/messages.go b/matterclient/messages.go
index c2325c09..b46feff1 100644
--- a/matterclient/messages.go
+++ b/matterclient/messages.go
@@ -10,14 +10,14 @@ func (m *MMClient) parseActionPost(rmsg *Message) {
// add post to cache, if it already exists don't relay this again.
// this should fix reposts
if ok, _ := m.lruCache.ContainsOrAdd(digestString(rmsg.Raw.Data["post"].(string)), true); ok {
- m.log.Debugf("message %#v in cache, not processing again", rmsg.Raw.Data["post"].(string))
+ m.logger.Debugf("message %#v in cache, not processing again", rmsg.Raw.Data["post"].(string))
rmsg.Text = ""
return
}
data := model.PostFromJson(strings.NewReader(rmsg.Raw.Data["post"].(string)))
// we don't have the user, refresh the userlist
if m.GetUser(data.UserId) == nil {
- m.log.Infof("User '%v' is not known, ignoring message '%#v'",
+ m.logger.Infof("User '%v' is not known, ignoring message '%#v'",
data.UserId, data)
return
}
@@ -54,7 +54,7 @@ func (m *MMClient) parseMessage(rmsg *Message) {
}
case "group_added":
if err := m.UpdateChannels(); err != nil {
- m.log.Errorf("failed to update channels: %#v", err)
+ m.logger.Errorf("failed to update channels: %#v", err)
}
/*
case model.ACTION_USER_REMOVED:
@@ -178,18 +178,18 @@ func (m *MMClient) SendDirectMessage(toUserId string, msg string, rootId string)
}
func (m *MMClient) SendDirectMessageProps(toUserId string, msg string, rootId string, props map[string]interface{}) { //nolint:golint
- m.log.Debugf("SendDirectMessage to %s, msg %s", toUserId, msg)
+ m.logger.Debugf("SendDirectMessage to %s, msg %s", toUserId, msg)
// create DM channel (only happens on first message)
_, resp := m.Client.CreateDirectChannel(m.User.Id, toUserId)
if resp.Error != nil {
- m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, resp.Error)
+ m.logger.Debugf("SendDirectMessage to %#v failed: %s", toUserId, resp.Error)
return
}
channelName := model.GetDMNameFromIds(toUserId, m.User.Id)
// update our channels
if err := m.UpdateChannels(); err != nil {
- m.log.Errorf("failed to update channels: %#v", err)
+ m.logger.Errorf("failed to update channels: %#v", err)
}
// build & send the message