Skip to content

Conversation

gnatykdm
Copy link
Owner

@gnatykdm gnatykdm commented Aug 3, 2025

No description provided.

@gnatykdm gnatykdm requested a review from Copilot August 3, 2025 07:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR standardizes the logger message formatting across the telegram bot project by removing the inconsistent double-dash prefixes from print statements and ensuring consistent spacing around log level indicators.

  • Standardized log message format from "-- [LEVEL]" and "--[LEVEL]" to "[LEVEL] -"
  • Fixed a spelling error in method name from dicrement to decrement
  • Added missing log level prefix to one feedback message

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
telegram_bot_project/service/smtp.py Updated SMTP service log messages to use consistent formatting
telegram_bot_project/bot/handlers.py Fixed log formatting and corrected method name spelling
telegram_bot_project/bot/fallbacks.py Standardized debug log message format
telegram_bot_project/bot/commands.py Updated command handler log messages for consistency
telegram_bot_project/bot/callbacks.py Standardized callback handler log messages

return

print("-- [INFO] - Feedback message from user with id: {user_id} is: {feedback_message}")
print("[INFO] - Feedback message from user with id: {user_id} is: {feedback_message}")
Copy link
Preview

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The print statement uses string literal formatting with curly braces but doesn't use an f-string prefix. This will print the literal text with {user_id} and {feedback_message} instead of the actual variable values. Add an 'f' prefix before the string.

Suggested change
print("[INFO] - Feedback message from user with id: {user_id} is: {feedback_message}")
print(f"[INFO] - Feedback message from user with id: {user_id} is: {feedback_message}")

Copilot uses AI. Check for mistakes.

await state.clear()
case _:
print(f"--[INFO] - User {user_id} ({user_name}) sent invalid callback: {callback_query.data}")
print(f"[ERROR] - User {user_id} ({user_name}) sent invalid callback: {callback_query.data}")
Copy link
Preview

Copilot AI Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The log level was changed from [INFO] to [ERROR] for an invalid callback, but this appears to be a user input validation issue rather than an actual error. Invalid user input is typically logged at INFO or DEBUG level, not ERROR level which is reserved for actual system errors.

Suggested change
print(f"[ERROR] - User {user_id} ({user_name}) sent invalid callback: {callback_query.data}")
print(f"[INFO] - User {user_id} ({user_name}) sent invalid callback: {callback_query.data}")

Copilot uses AI. Check for mistakes.

@gnatykdm gnatykdm merged commit f2c637a into master Aug 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant