Replace loguru with the standard-library logging module#6992
Open
omkar-334 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the libraries/getitrack component off the third-party loguru logger and onto Python’s standard-library logging, aiming to keep the package silent by default while enabling concise console output when a tracker is constructed with verbose=True.
Changes:
- Removed
logurufromgetitrackdependencies (pyproject.toml,uv.lock) and deleted the previouslogger.disable("getitrack")initialization. - Introduced a package-scoped stdlib
LOGGERwith a defaultNullHandler, plus anenable_logging()helper that sets level and adds a console handler. - Updated runtime logging call sites and unit tests to use stdlib logging semantics (
%-style formatting,caplogcapture).
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| libraries/getitrack/uv.lock | Drops loguru (and transitive) entries from the lockfile. |
| libraries/getitrack/pyproject.toml | Removes loguru from declared dependencies. |
| libraries/getitrack/src/getitrack/init.py | Removes loguru-based default suppression. |
| libraries/getitrack/src/getitrack/logger.py | Adds stdlib LOGGER, NullHandler, and enable_logging() helper. |
| libraries/getitrack/src/getitrack/core/base.py | Enables logging when verbose=True and updates INFO formatting to stdlib logging style. |
| libraries/getitrack/src/getitrack/core/track.py | Updates DEBUG formatting to stdlib logging style. |
| libraries/getitrack/tests/unit/test_base.py | Replaces loguru sink-based assertions with pytest’s caplog for stdlib logging. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Summary
Moves getitrack off the third-party loguru dependency and onto Python's standard logging module.
Behavior
NullHandleris attached.verbose=True: enable_loggingsets the level to INFO and attaches a console handler, so per-frame summaries appear. Track state transitions log at DEBUG and remain hidden unless the application lowers the level.Checklist