Clean backend debug logging and standardize error reporting.

This removes verbose trace output in handlers/services and keeps only actionable error-level logs.
This commit is contained in:
2026-03-09 22:18:53 +08:00
parent 4d8f2ec997
commit 4c0177149a
13 changed files with 8 additions and 163 deletions

View File

@@ -137,7 +137,7 @@ func (s *CommentService) afterCommentPublished(userID, postID, commentID string,
if parentUserID != userID {
notifyErr := s.systemMessageService.SendReplyNotification(context.Background(), parentUserID, userID, postID, *parentID, commentID)
if notifyErr != nil {
fmt.Printf("[DEBUG] Error sending reply notification: %v\n", notifyErr)
log.Printf("[ERROR] Error sending reply notification: %v", notifyErr)
}
}
} else {
@@ -145,7 +145,7 @@ func (s *CommentService) afterCommentPublished(userID, postID, commentID string,
if postOwnerID != userID {
notifyErr := s.systemMessageService.SendCommentNotification(context.Background(), postOwnerID, userID, postID, commentID)
if notifyErr != nil {
fmt.Printf("[DEBUG] Error sending comment notification: %v\n", notifyErr)
log.Printf("[ERROR] Error sending comment notification: %v", notifyErr)
}
}
}
@@ -252,9 +252,7 @@ func (s *CommentService) Like(ctx context.Context, commentID, userID string) err
)
}
if notifyErr != nil {
fmt.Printf("[DEBUG] Error sending like notification: %v\n", notifyErr)
} else {
fmt.Printf("[DEBUG] Like notification sent successfully\n")
log.Printf("[ERROR] Error sending like notification: %v", notifyErr)
}
}()
}