LOW: Fix logger.error() misuse for non-error messages in bot.py #42

Open
opened 2026-02-20 14:51:35 +02:00 by Koko210 · 0 comments
Owner

Problem

In bot/bot.py, logger.error() is used for informational messages that are not actual errors. For example, messages like 'Processing embed from message...' are logged at ERROR level when they should be DEBUG or INFO.

This causes:

  • False alarms when monitoring error logs
  • Noise in error-level log files (the logger system writes per-component log files)
  • Difficulty distinguishing real errors from routine processing messages
  • Potential alert fatigue if error-level logs trigger notifications

Proposed Solution

Audit bot/bot.py (and potentially other files) for logger.error() calls and re-classify:

  • Routine processing messages -> logger.debug() or logger.info()
  • Expected-but-notable conditions -> logger.warning()
  • Actual failures -> logger.error() (keep as-is)

Quick audit command:

grep -n 'logger.error' bot/bot.py

Review each hit and determine if it represents an actual error condition.

Impact

  • Risk: None (logging level changes only)
  • Effort: Trivial (review and reclassify ~10-15 log calls)
  • Benefit: Clean error logs, reliable monitoring

Files Affected

  • bot/bot.py (primary)
  • Potentially other files (audit with grep -rn 'logger.error' bot/)
## Problem In bot/bot.py, logger.error() is used for informational messages that are not actual errors. For example, messages like 'Processing embed from message...' are logged at ERROR level when they should be DEBUG or INFO. This causes: - False alarms when monitoring error logs - Noise in error-level log files (the logger system writes per-component log files) - Difficulty distinguishing real errors from routine processing messages - Potential alert fatigue if error-level logs trigger notifications ## Proposed Solution Audit bot/bot.py (and potentially other files) for logger.error() calls and re-classify: - Routine processing messages -> logger.debug() or logger.info() - Expected-but-notable conditions -> logger.warning() - Actual failures -> logger.error() (keep as-is) ### Quick audit command: grep -n 'logger.error' bot/bot.py Review each hit and determine if it represents an actual error condition. ## Impact - Risk: None (logging level changes only) - Effort: Trivial (review and reclassify ~10-15 log calls) - Benefit: Clean error logs, reliable monitoring ## Files Affected - bot/bot.py (primary) - Potentially other files (audit with grep -rn 'logger.error' bot/)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Koko210/miku-discord#42