Skip to content

logging refresh#229

Open
cjw296 wants to merge 12 commits intomainfrom
logging-refresh
Open

logging refresh#229
cjw296 wants to merge 12 commits intomainfrom
logging-refresh

Conversation

@cjw296
Copy link
Copy Markdown
Member

@cjw296 cjw296 commented Mar 25, 2026

  • support loguru
  • unify twisted LogCapture and existing LogCapture

cjw296 and others added 12 commits March 19, 2026 22:08
LogCapture no longer inherits from logging.Handler. All logging-specific
logic moves to LoggingSource (in new capturing.py), which becomes the
actual handler. LogCapture owns a list of Entry objects and a collector
callback, keeping it decoupled from the logging framework.

Public API is unchanged; records becomes a deprecated compatibility
property backed by entries.
`ensure_checked` uses this and now also uses `None` instead of `logging.NOTSET` as its sentinel
- Add exception field to Entry, populated by LoggingSource and TwistedSource
- Refactor LogCapture to multi-source (_sources list) with sources= constructor param
- Add LoggingSource.__repr__ for cleaner warning messages
- Add order_matters param to LogCapture.check()
- Add raise_first_exception(), check_exception_str(), make() to LogCapture
- Add TwistedSource to testfixtures.twisted
- Document Entry as public API; update docs/twisted.rst with unified usage section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Removes ~80 lines of duplicated logic (install, uninstall, check, make)
- events property exposes raw Twisted events for backward compat
- Only keeps check_failure_text and raise_logged_failure (Twisted-specific)
- Update 3 order_matters=False tests to match SequenceComparison error format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant