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:
@@ -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)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user