Skip to content

Conversation

@jmarshall
Copy link
Contributor

@jmarshall jmarshall commented Aug 15, 2025

As per the loguru documentation.

See batch 631674 which ran on an image that includes this PR — note the log ends with log messages from modules within /cpg-flow/.venv/lib/… whereas batch 631672 is of similar vintage but does not contain this PR and omits these log messages.

Before merging this, we would need to consider whether we facilitate cpg-flow-using workflows that prefer standard logging rather than loguru, and what the desired behaviour there would be — perhaps to redirect cpg-flow's loguru messages to the standard logger instead.

…andler

As per loguru documentation (see the "Entirely compatible with standard
logging" section).
@jmarshall jmarshall requested a review from a team as a code owner August 15, 2025 03:21
@cpg-software-ci-bot
Copy link
Contributor

📊 SonarQube Summary

Metric This PR Main Branch
✅ Coverage 76.4% 76.3%
💨 Code Smells 12 12
🐞 Bugs 0 0
🔐 Vulnerabilities 0 0
🚨 Security Hotspots 1 0
📝 New Issues 0 0
🌟 Quality Gate ✅ OK ✅ OK

🔗 View Main Branch Report
🔗 View PR Report

@github-actions
Copy link
Contributor

🐳 Docker Image Built

A new Docker image has been built for this PR:

Image: australia-southeast1-docker.pkg.dev/cpg-common/images-dev/cpg_flow:d8f3b5a361b9ca90f74b21bf090ffa1afeab3ce1

Pull command:

docker pull australia-southeast1-docker.pkg.dev/cpg-common/images-dev/cpg_flow:d8f3b5a361b9ca90f74b21bf090ffa1afeab3ce1

🔗 View in Google Cloud Console


This comment was automatically generated by the Docker workflow.

@vivbak vivbak requested a review from nevoodoo August 17, 2025 22:53
Copy link

@dancoates dancoates left a comment

Choose a reason for hiding this comment

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

Looks good, a bit of a fiddly implementation but as per the docs you linked this does seem to be the advised way to have loguru intercept standard logging.

@jmarshall
Copy link
Contributor Author

jmarshall commented Aug 18, 2025

Indeed… You would think loguru could provide a suitable default InterceptHandler rather than inviting everyone to write it themselves…

ETA: Requested three years ago: Delgan/loguru#633.

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.

4 participants