fix: replace print() debug statements with logger calls in db_engine.py (#22) #53
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#53
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/major-domo-database-22"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces 4
print()calls inapp/db_engine.pythat were bypassing the rotating file logger with properlogger.error()calls.Lines changed:
print(f'I could not drop {move.player.name}')→logger.error(...)(active roster drop)print(f'**Error** (db_engine player): {e}')→logger.error(...)inPlayer.get_season()All four calls now route through the module-level
logger = logging.getLogger('discord_app')and will appear in/tmp/sba-database.log.Files Changed
app/db_engine.py(4 lines)Tests
No test suite — changes verified by reading modified lines in context.
Other observations
except:— covered by PR #50 (fix: replace bare except: with except Exception:).AI Code Review
Files Reviewed
app/db_engine.py(modified)Findings
Correctness
print()→logger.error()substitutions are correct.logger = logging.getLogger('discord_app')(line 42) is in scope at all 4 call sites.except:blocks and reference onlymove.player.name— no exception variable needed, format strings are valid.except Exception as e:—eis correctly in scope for the error message.Security
Style & Conventions
logger.error()matches the existing pattern used throughout the codebase.loggeralready defined at module level.Suggestions
Notes
except:blocks at lines 461, 522, 583 are pre-existing and correctly noted by the author as covered by PR #50 — out of scope here.finally: return playerpattern at line 891–892 (suppresses exceptions) is pre-existing, not introduced by this PR.Verdict: APPROVED
Clean, minimal change. All 4 print() calls correctly replaced with logger.error() calls that will appear in
/tmp/sba-database.log. No issues found.Automated review by Claude PR Reviewer
Checkout
From your project repository, check out a new branch and test the changes.