From 29c738dc9db11e2572bc14f0ede783522c2c3e04 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 16 Sep 2019 23:28:13 +0200 Subject: [PATCH] Converting to structured logging the file app/email_batching.go (#12127) * Converting to structured logging the file app/email_batching.go * reverting to fmt.Sprintf as per need --- app/email_batching.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/email_batching.go b/app/email_batching.go index 1631b0d21e..01f82f31e4 100644 --- a/app/email_batching.go +++ b/app/email_batching.go @@ -142,7 +142,7 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu team, err := job.server.Store.Team().GetByName(notifications[0].teamName) if err != nil { - mlog.Error(fmt.Sprint("Unable to find Team id for notification", err)) + mlog.Error("Unable to find Team id for notification", mlog.Err(err)) continue } @@ -154,13 +154,13 @@ func (job *EmailBatchingJob) checkPendingNotifications(now time.Time, handler fu // all queued notifications channelMembers, err := job.server.Store.Channel().GetMembersForUser(inspectedTeamNames[notification.teamName], userId) if err != nil { - mlog.Error(fmt.Sprint("Unable to find ChannelMembers for user", err)) + mlog.Error("Unable to find ChannelMembers for user", mlog.Err(err)) continue } for _, channelMember := range *channelMembers { if channelMember.LastViewedAt >= batchStartTime { - mlog.Debug(fmt.Sprintf("Deleted notifications for user %s", userId), mlog.String("user_id", userId)) + mlog.Debug("Deleted notifications for user", mlog.String("user_id", userId)) delete(job.pendingNotifications, userId) break } @@ -241,7 +241,7 @@ func (s *Server) sendBatchedEmailNotification(userId string, notifications []*ba body.Props["BodyText"] = translateFunc("api.email_batching.send_batched_email_notification.body_text", len(notifications)) if err := s.FakeApp().SendNotificationMail(user.Email, subject, body.Render()); err != nil { - mlog.Warn(fmt.Sprintf("Unable to send batched email notification err=%v", err), mlog.String("email", user.Email)) + mlog.Warn("Unable to send batched email notification", mlog.String("email", user.Email), mlog.Err(err)) } }