Fix logs package refactor: restore compatibility and forward Loguru into stdlib logging#153
Merged
Merged
Conversation
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.
Motivation
logsimports and breaking tooling that expects a logging-style API.caplog) stop observing warnings because records no longer flow into Python's standardloggingsystem.Description
netengine.logsinstead of unresolved top-levellogsand updated FastAPI middleware import innetengine/api/app.py.netengine/logs/__init__.py(getLogger,Loggeralias, and standard level constantsDEBUG/INFO/WARNING/ERROR/CRITICAL) so existing callers and tests using a logging-like API continue to work.netengine/logs/core.pythat forwards Loguru records into Python'sloggingvia an addedadd_stdlib_sinksink so integrations (e.g., pytestcaplog) and other stdlib consumers capture emitted warnings/errors.pyproject.tomlmypy excludes) to the newnetengine/logslayout and adjusted test fixtures to importnetengine.logs.Testing
pytest tests/test_spec_parsing.py tests/test_pgmq_emitters.py -qand the focused suite passed (28 tests passed).python -m compileall -q netengine tests/conftest.py tests/test_spec_parsing.py tests/test_pgmq_emitters.pywhich succeeded.pytest -qbut collection was blocked by a pre-existingIndentationErrorintests/test_doctor.py, which is unrelated to the logging changes and prevented completing the entire suite.Codex Task