-
Notifications
You must be signed in to change notification settings - Fork 0
Logger-Fixed-Message-Formatting #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
dicrementtodecrement - 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 |
telegram_bot_project/bot/handlers.py
Outdated
| 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}") |
Copilot
AI
Aug 3, 2025
There was a problem hiding this comment.
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.
| 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}") |
| 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}") |
Copilot
AI
Aug 3, 2025
There was a problem hiding this comment.
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.
| 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}") |
No description provided.