Skip to content

Replace print statements with logger calls across package modules #61

Description

@d-lazenby

Summary

Several modules in the package use print() with manual [ERROR]/[WARN] prefixes instead of the standard logging module. This bypasses the logging configuration established in cli.py (level filtering, formatting, handler routing) and makes the output uncontrollable for downstream consumers.

Affected files:

  • clients/github_api.py — 4 error prints in get_latest_github_tag and get_commit_hash_for_tag
  • clients/registry_api.py — 2 error prints
  • updaters/github_source.py — 1 info-level print
  • updaters/registry_source.py — 1 error print
  • discovery.py — 1 warning print + loop

Proposed fix:

Add a module-level logger to each affected file (as already done in app.py):

logger = logging.getLogger(__name__)

Then replace each print(...) with the appropriate logger.error(...), logger.warning(...) or logger.info(...) call, removing the manual [ERROR]/[WARN] prefixes.

Out of scope: The print calls in cli.py's exception handlers — these are at the entry point and are acceptable as is.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions