From 9fa6e80e55db6f32fd0194186d14359c004abe4f Mon Sep 17 00:00:00 2001 From: Andre Polykanine Date: Thu, 24 Oct 2019 08:44:01 +0300 Subject: [PATCH] Refactor app/notification_email.go for structure logging (#12740) --- app/notification_email.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/notification_email.go b/app/notification_email.go index a2fbb6766d..cdd7ae7ef9 100644 --- a/app/notification_email.go +++ b/app/notification_email.go @@ -100,7 +100,7 @@ func (a *App) sendNotificationEmail(notification *postNotification, user *model. a.Srv.Go(func() { if err := a.SendNotificationMail(user.Email, html.UnescapeString(subjectText), bodyText); err != nil { - mlog.Error(fmt.Sprint("Error to send the email", user.Email, err)) + mlog.Error("Error while sending the email", mlog.String("email", user.Email), mlog.Err(err)) } }) @@ -320,7 +320,7 @@ func (a *App) GetMessageForNotification(post *model.Post, translateFunc i18n.Tra // extract the filenames from their paths and determine what type of files are attached infos, err := a.Srv.Store.FileInfo().GetForPost(post.Id, true, false, true) if err != nil { - mlog.Warn(fmt.Sprintf("Encountered error when getting files for notification message, post_id=%v, err=%v", post.Id, err), mlog.String("post_id", post.Id)) + mlog.Warn("Encountered error when getting files for notification message", mlog.String("post_id", post.Id), mlog.Err(err)) } filenames := make([]string, len(infos))