diff options
Diffstat (limited to 'internal/db/comment.go')
-rw-r--r-- | internal/db/comment.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/db/comment.go b/internal/db/comment.go index b2f19508..d0270302 100644 --- a/internal/db/comment.go +++ b/internal/db/comment.go @@ -10,7 +10,7 @@ import ( "time" "github.com/unknwon/com" - log "gopkg.in/clog.v1" + log "unknwon.dev/clog/v2" "xorm.io/xorm" api "github.com/gogs/go-gogs-client" @@ -180,7 +180,7 @@ func (cmt *Comment) mailParticipants(e Engine, opType ActionType, issue *Issue) issue.Content = fmt.Sprintf("Reopened #%d", issue.Index) } if err = mailIssueCommentToParticipants(issue, cmt.Poster, mentions); err != nil { - log.Error(2, "mailIssueCommentToParticipants: %v", err) + log.Error("mailIssueCommentToParticipants: %v", err) } return nil @@ -282,10 +282,10 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err // Notify watchers for whatever action comes in, ignore if no action type. if act.OpType > 0 { if err = notifyWatchers(e, act); err != nil { - log.Error(2, "notifyWatchers: %v", err) + log.Error("notifyWatchers: %v", err) } if err = comment.mailParticipants(e, act.OpType, opts.Issue); err != nil { - log.Error(2, "MailParticipants: %v", err) + log.Error("MailParticipants: %v", err) } } @@ -356,7 +356,7 @@ func CreateIssueComment(doer *User, repo *Repository, issue *Issue, content stri Repository: repo.APIFormat(nil), Sender: doer.APIFormat(), }); err != nil { - log.Error(2, "PrepareWebhooks [comment_id: %d]: %v", comment.ID, err) + log.Error("PrepareWebhooks [comment_id: %d]: %v", comment.ID, err) } return comment, nil @@ -465,7 +465,7 @@ func UpdateComment(doer *User, c *Comment, oldContent string) (err error) { } if err = c.Issue.LoadAttributes(); err != nil { - log.Error(2, "Issue.LoadAttributes [issue_id: %d]: %v", c.IssueID, err) + log.Error("Issue.LoadAttributes [issue_id: %d]: %v", c.IssueID, err) } else if err = PrepareWebhooks(c.Issue.Repo, HOOK_EVENT_ISSUE_COMMENT, &api.IssueCommentPayload{ Action: api.HOOK_ISSUE_COMMENT_EDITED, Issue: c.Issue.APIFormat(), @@ -478,7 +478,7 @@ func UpdateComment(doer *User, c *Comment, oldContent string) (err error) { Repository: c.Issue.Repo.APIFormat(nil), Sender: doer.APIFormat(), }); err != nil { - log.Error(2, "PrepareWebhooks [comment_id: %d]: %v", c.ID, err) + log.Error("PrepareWebhooks [comment_id: %d]: %v", c.ID, err) } return nil @@ -516,11 +516,11 @@ func DeleteCommentByID(doer *User, id int64) error { _, err = DeleteAttachmentsByComment(comment.ID, true) if err != nil { - log.Error(2, "Failed to delete attachments by comment[%d]: %v", comment.ID, err) + log.Error("Failed to delete attachments by comment[%d]: %v", comment.ID, err) } if err = comment.Issue.LoadAttributes(); err != nil { - log.Error(2, "Issue.LoadAttributes [issue_id: %d]: %v", comment.IssueID, err) + log.Error("Issue.LoadAttributes [issue_id: %d]: %v", comment.IssueID, err) } else if err = PrepareWebhooks(comment.Issue.Repo, HOOK_EVENT_ISSUE_COMMENT, &api.IssueCommentPayload{ Action: api.HOOK_ISSUE_COMMENT_DELETED, Issue: comment.Issue.APIFormat(), @@ -528,7 +528,7 @@ func DeleteCommentByID(doer *User, id int64) error { Repository: comment.Issue.Repo.APIFormat(nil), Sender: doer.APIFormat(), }); err != nil { - log.Error(2, "PrepareWebhooks [comment_id: %d]: %v", comment.ID, err) + log.Error("PrepareWebhooks [comment_id: %d]: %v", comment.ID, err) } return nil } |