Skip to content

Replace loguru with the standard-library logging module#6992

Open
omkar-334 wants to merge 2 commits into
open-edge-platform:feature/getitrackfrom
omkar-334:getitrack-logging
Open

Replace loguru with the standard-library logging module#6992
omkar-334 wants to merge 2 commits into
open-edge-platform:feature/getitrackfrom
omkar-334:getitrack-logging

Conversation

@omkar-334

Copy link
Copy Markdown
Contributor

Summary

Moves getitrack off the third-party loguru dependency and onto Python's standard logging module.

Behavior

  1. Default: nothing is printed. Only the NullHandler is attached.
  2. verbose=True: enable_logging sets 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

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

Copilot AI review requested due to automatic review settings July 7, 2026 22:34
@omkar-334 omkar-334 changed the base branch from develop to feature/getitrack July 7, 2026 22:34
@omkar-334 omkar-334 requested a review from a team as a code owner July 7, 2026 22:34
@github-actions github-actions Bot added DEPENDENCY Any changes in any dependencies (new dep or its version) should be produced via Change Request on PM TEST Any changes in tests BUILD DOC Improvements or additions to documentation labels Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 loguru from getitrack dependencies (pyproject.toml, uv.lock) and deleted the previous logger.disable("getitrack") initialization.
  • Introduced a package-scoped stdlib LOGGER with a default NullHandler, plus an enable_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, caplog capture).

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.

Comment thread libraries/getitrack/src/getitrack/logger.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BUILD DEPENDENCY Any changes in any dependencies (new dep or its version) should be produced via Change Request on PM DOC Improvements or additions to documentation TEST Any changes in tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants