Skip to content

fix: Replace print statements with logging and logging modular level (PR2) - #478

Draft
MoralCode wants to merge 4 commits into
mainfrom
PredictiveManish/libyear-util-update
Draft

MoralCode wants to merge 4 commits into
mainfrom
PredictiveManish/libyear-util-update

Conversation

@MoralCode

Copy link
Copy Markdown
Contributor

Note

This PR was ported from augurlabs/augur#3648 filed by @PredictiveManish because the contribution was deemed to still be useful.

Description
This PR standardizes the logging implementation across libyear_util to follow Python best practices and solve #114:

Changes Made:

  1. Added module-level loggers: Each module now uses logger = logging.getLogger(__name__)
  2. Eliminated print statements: All console output now uses proper logging
  3. Fixed inconsistent patterns: Removed logger parameter passing in favor of module-level loggers
  4. Improved import organization: Removed duplicate imports

This PR partially solves #114

Notes for Reviewers

  • Consistent logging behavior across the codebase
  • Better control over log levels and output
  • Follows Python logging best practices
  • Easier debugging and monitoring
  • Cleaner separation of concerns

Testing

  • Enabled Python logging locally
  • Verified log messages emit via logger.info
  • No changes to control flow or task behavior
  • Verified logging output locally with logging.basicConfig(level=INFO).

Signed commits

  • Yes, I signed my commits.

Signed-off-by: PredictiveManish <manish.tiwari.09@zohomail.in>
Signed-off-by: PredictiveManish <manish.tiwari.09@zohomail.in>
Signed-off-by: PredictiveManish <manish.tiwari.09@zohomail.in>
Added logger parameter to get_release_date function.

Signed-off-by: Manish Tiwari <manish.tiwari.09@zohomail.in>


def get_release_date(data, version,logger):
def get_release_date(data, version, logger):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'logger' from outer scope (line 8) (redefined-outer-name)

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.

2 participants