Skip to content

fix: replace print() with logger.error() in _do_cleanup#116

Merged
cmeans-claude-dev[bot] merged 1 commit into
mainfrom
fix/cleanup-logging
Mar 30, 2026
Merged

fix: replace print() with logger.error() in _do_cleanup#116
cmeans-claude-dev[bot] merged 1 commit into
mainfrom
fix/cleanup-logging

Conversation

@cmeans-claude-dev
Copy link
Copy Markdown
Contributor

@cmeans-claude-dev cmeans-claude-dev Bot commented Mar 30, 2026

Summary

  • Replaced print() call in PostgresStore._do_cleanup with logger.error() to use the module's existing logging infrastructure (MEDIUM Add awareness workflow guidance to CLAUDE.md #6)
  • Updated corresponding test to assert on caplog instead of capsys
  • Added CHANGELOG entry under ### Changed

QA

Prerequisites

  • pip install -e ".[dev]"
  • Deploy to test instance on alternate port (AWARENESS_PORT=8421)

Manual tests (via MCP tools)

    • Verify cleanup error logging
      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 from mcp_awareness.postgres_store logger

🤖 Generated with Claude Code

@cmeans-claude-dev cmeans-claude-dev Bot added the Dev Active Developer is actively working on this PR; QA should not start label Mar 30, 2026
@github-actions github-actions Bot added the Awaiting CI Dev complete, waiting for CI/Codecov to pass before QA label Mar 30, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 30, 2026

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>
@cmeans cmeans force-pushed the fix/cleanup-logging branch from ffcf17e to 665bec6 Compare March 30, 2026 23:31
@cmeans-claude-dev cmeans-claude-dev Bot added Ready for QA Dev work complete — QA can begin review and removed Dev Active Developer is actively working on this PR; QA should not start Awaiting CI Dev complete, waiting for CI/Codecov to pass before QA labels Mar 30, 2026
@cmeans cmeans added QA Active QA is actively reviewing; Dev should not push changes and removed Ready for QA Dev work complete — QA can begin review labels Mar 30, 2026
Copy link
Copy Markdown
Owner

@cmeans cmeans left a comment

Choose a reason for hiding this comment

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

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

@cmeans
Copy link
Copy Markdown
Owner

cmeans commented Mar 30, 2026

QA Audit — PR #116

CI: All green | Tests: 527/527 pass

# Severity Finding
No findings
Adding Ready for QA Signoff.

@cmeans cmeans added Ready for QA Signoff QA passed — ready for maintainer final review and merge and removed QA Active QA is actively reviewing; Dev should not push changes labels Mar 30, 2026
Copy link
Copy Markdown
Owner

@cmeans cmeans left a comment

Choose a reason for hiding this comment

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

LGTM

@cmeans cmeans added QA Approved Manual QA testing completed and passed and removed Ready for QA Signoff QA passed — ready for maintainer final review and merge labels Mar 30, 2026
@cmeans-claude-dev cmeans-claude-dev Bot merged commit a7c6333 into main Mar 30, 2026
47 checks passed
@cmeans-claude-dev cmeans-claude-dev Bot deleted the fix/cleanup-logging branch March 30, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Approved Manual QA testing completed and passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant