From 8ae5905e1e3cd68d128ec6acffb802dc3fe9749e Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 9 Jan 2017 15:51:12 +0000 Subject: [PATCH] Code review --- config.sample.yaml | 1 - .../matrix-org/go-neb/services/slackapi/slackapi.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config.sample.yaml b/config.sample.yaml index 456c8cc..c632fa6 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -111,7 +111,6 @@ services: - ID: "slackapi_service" Type: "slackapi" - UserID: "@slackapi:localhost" # requires a Syncing client Config: Hooks: "hook1": diff --git a/src/github.com/matrix-org/go-neb/services/slackapi/slackapi.go b/src/github.com/matrix-org/go-neb/services/slackapi/slackapi.go index c7cf278..de1a4e9 100644 --- a/src/github.com/matrix-org/go-neb/services/slackapi/slackapi.go +++ b/src/github.com/matrix-org/go-neb/services/slackapi/slackapi.go @@ -38,14 +38,14 @@ func (s *Service) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli slackMessage, err := getSlackMessage(*req) if err != nil { - log.WithFields(log.Fields{"slackMessage":slackMessage, "err":err}).Print("Slack message error") + log.WithFields(log.Fields{"slackMessage":slackMessage, log.ErrorKey:err}).Error("Slack message error") w.WriteHeader(500) return } htmlMessage, err := slackMessageToHTMLMessage(slackMessage) if err != nil { - log.WithField("err", err).Error("Converting slack message to HTML") + log.WithError(err).Error("Converting slack message to HTML") w.WriteHeader(500) return }