fix(extensions): log extension-init failures via the logger, not print()#41304
fix(extensions): log extension-init failures via the logger, not print()#41304rusackas wants to merge 2 commits into
Conversation
init_extensions caught extension-initialization exceptions and wrote them to stdout via print(), bypassing the structured logging pipeline so the failures were invisible to operators relying on log aggregation. Route these through logger.exception (with the failing extension id and a traceback) so they reach the configured logging destinations. Adds a unit test asserting an extension entrypoint failure is logged via logger.exception including the extension id. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Code Review Agent Run #37e6abActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41304 +/- ##
==========================================
- Coverage 64.34% 64.34% -0.01%
==========================================
Files 2653 2653
Lines 144952 144952
Branches 33433 33433
==========================================
- Hits 93273 93268 -5
- Misses 49995 49998 +3
- Partials 1684 1686 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SUMMARY
init_extensionscaught extension-initialization exceptions and emitted them viaprint(ex)to stdout, bypassing the configured structured logging pipeline (formatting, severity levels, configured destinations). Initialization failures were therefore invisible to operators relying on log aggregation.This routes those failures through
logger.exception(...), which records the failing extension id and a full traceback at error level through the standard logger.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — logging behavior.
TESTING INSTRUCTIONS
Unit test added in
tests/unit_tests/test_init_extensions_logging.py: an extension entrypoint that raises during init is logged vialogger.exception, and the failing extension id is included in the log args.Run:
pytest tests/unit_tests/test_init_extensions_logging.pyADDITIONAL INFORMATION