Converting to structured logging the file app/webhook.go (#12142)

Этот коммит содержится в:
Nikhil Ranjan
2019-09-13 07:31:59 +02:00
коммит произвёл CJ
родитель d9fa46e0a2
Коммит 9f54e8267f

Просмотреть файл

@@ -4,7 +4,6 @@
package app package app
import ( import (
"fmt"
"io" "io"
"net/http" "net/http"
"regexp" "regexp"
@@ -108,7 +107,7 @@ func (a *App) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.
a.Srv.Go(func() { a.Srv.Go(func() {
webhookResp, err := a.doOutgoingWebhookRequest(url, body, contentType) webhookResp, err := a.doOutgoingWebhookRequest(url, body, contentType)
if err != nil { if err != nil {
mlog.Error(fmt.Sprintf("Event POST failed, err=%s", err.Error())) mlog.Error("Event POST failed.", mlog.Err(err))
return return
} }
@@ -139,7 +138,7 @@ func (a *App) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.
webhookResp.IconURL = hook.IconURL webhookResp.IconURL = hook.IconURL
} }
if _, err := a.CreateWebhookPost(hook.CreatorId, channel, text, webhookResp.Username, webhookResp.IconURL, "", webhookResp.Props, webhookResp.Type, postRootId); err != nil { if _, err := a.CreateWebhookPost(hook.CreatorId, channel, text, webhookResp.Username, webhookResp.IconURL, "", webhookResp.Props, webhookResp.Type, postRootId); err != nil {
mlog.Error(fmt.Sprintf("Failed to create response post, err=%v", err)) mlog.Error("Failed to create response post.", mlog.Err(err))
} }
} }
}) })