Skip to content

fix: restore logger levels after silencing machine output - #2011

Open
Aman-goel-04 wants to merge 3 commits into
repowise-dev:mainfrom
Aman-goel-04:fix/silence-logs-machine-output-1976
Open

fix: restore logger levels after silencing machine output#2011
Aman-goel-04 wants to merge 3 commits into
repowise-dev:mainfrom
Aman-goel-04:fix/silence-logs-machine-output-1976

Conversation

@Aman-goel-04

@Aman-goel-04 Aman-goel-04 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prevents machine-output log silencing from leaking process-global stdlib logger levels across CLI commands and tests.
  • Restores the complete prior structlog configuration after machine-output commands finish, including Click option-callback paths.
  • Adds regression coverage for scoped log silencing and restores the adapter markdown-output test.

Related Issues

Fixes #1976

Test Plan

  • Lint passes (ruff check .) — CI passed
  • Tests pass (pytest) — CI passed on Python 3.11, 3.12, and 3.13
  • Web build passes (npm run build) (no frontend changes)

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • All existing tests still pass
  • I have updated documentation if needed

@Aman-goel-04

Copy link
Copy Markdown
Contributor Author

@RaghavChamadiya, please review this PR and let me know if any changes need to be made!

@Aman-goel-04
Aman-goel-04 force-pushed the fix/silence-logs-machine-output-1976 branch from 500dd13 to 8653f1e Compare September 8, 2026 09:38
@Aman-goel-04 Aman-goel-04 changed the title wip: silence_logs_for_machine_output fix fix: restore logger levels after silencing machine output Sep 8, 2026
@Aman-goel-04

Copy link
Copy Markdown
Contributor Author

Hey @RaghavChamadiya, rebased this onto current main to clear the conflict (there was a real merge collision in health_cmd/command.py against the new --scope production/all feature, resolved so both land together), and fixed a test that referenced the pre-rename helper name. CI's green and it's mergeable now, ready whenever you get a chance to take another look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

silence_logs_for_machine_output mutates global logger levels with no restore, so caplog assertions fail only in a full test run

1 participant