fix: replace print() with logger.error() in _do_cleanup#116
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The _do_cleanup method used print() for error reporting instead of the module's logging infrastructure. This made cleanup failures invisible to log aggregation and monitoring systems. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ffcf17e to
665bec6
Compare
cmeans
reviewed
Mar 30, 2026
Owner
cmeans
left a comment
There was a problem hiding this comment.
QA Review — PR #116: Replace print() with logger.error() in _do_cleanup (MEDIUM #6)
Reviewer: QA Agent | Date: 2026-03-30
Code Review: PASS
One-line change: print(f"[awareness] cleanup failed: ...") → logger.error("Cleanup failed: %s: %s", ...). Test updated from capsys to caplog. Clean.
Tests: 527/527 PASS
test_do_cleanup_logs_errors now asserts on caplog.text at ERROR level for the mcp_awareness.postgres_store logger.
CI: All green
Findings: Zero
Owner
QA Audit — PR #116CI: All green | Tests: 527/527 pass
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
print()call inPostgresStore._do_cleanupwithlogger.error()to use the module's existing logging infrastructure (MEDIUM Add awareness workflow guidance to CLAUDE.md #6)caploginstead ofcapsys### ChangedQA
Prerequisites
pip install -e ".[dev]"AWARENESS_PORT=8421)Manual tests (via MCP tools)
Trigger a cleanup failure (e.g., stop Postgres while server is running) and confirm error appears in structured logs rather than stdout.
Expected: log line contains
Cleanup failed:at ERROR level frommcp_awareness.postgres_storelogger🤖 Generated with Claude Code