Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log outputs #490

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Improve log outputs #490

wants to merge 2 commits into from

Conversation

aspeake
Copy link
Collaborator

@aspeake aspeake commented Mar 27, 2025

Fixes #404

Improve ecm_prep logging, updates include:

  • Configure the logger to write to the console, as well as the log file
  • Mostly convert print statements to logger.infos
    • Note: left the print statements for the "Updating ECM ..." statements
  • Update verboseprint()
    • Still write to console but as a logger.info, logger.warning, or logger.error
    • Because these are logger messages, this also write to the log file
    • Convert to the message argument to f-strings
  • Update flake8 version: f-strings were giving an error due to a bug

This CI run shows the ecm_prep log file that is created and stored as an artifact, the new console outputs look like:
image

@aspeake aspeake added this to the v1.1.0 milestone Mar 27, 2025
@@ -25,7 +25,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install flake8==6.0
pip install flake8
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previously had to set the version due to a bug, but that has been corrected with the current flake8.

Comment on lines +43 to +46
# Write logger to console
console_handler = logging.StreamHandler()
console_handler.setFormatter(root_format)
logger.addHandler(console_handler)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All logging info is now printed to the console, this does not really change what was output, and mostly just replaces print statements

@aspeake aspeake requested a review from jtlangevin March 27, 2025 22:14
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.

Better log outputs for ecm_prep.py
1 participant