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

Route warnings to our logs #148

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Route warnings to our logs #148

merged 1 commit into from
Dec 19, 2024

Conversation

dmnapolitano
Copy link
Contributor

Description

Hi! The changes in this PR ensure that warnings appear in our logs. With logging.captureWarnings(True), Python creates a new logger called py.warnings and sends all of the warning messages there. The change in this PR will make sure messages on the py.warnings logger also appear alongside our elexmodel logger messages 🎉

Jira Ticket

Test Steps

Try this on develop and then on this branch:

elexmodel 2024-11-05_USA_G --estimands=margin --features=baseline_normalized_margin --office_id=S --geographic_unit_type=county --pi_method bootstrap --national_summary --model_parameters '{"extrapolation" : True, "versioned_start_date" : "2024-11-05T21:00:00-05:00", "versioned_end_date" : "2024-11-05T21:30:00-05:00"}'

😅

@dmnapolitano dmnapolitano requested a review from a team as a code owner December 18, 2024 19:22
@dmnapolitano
Copy link
Contributor Author

PR #146 👋🏻

@lennybronner
Copy link
Collaborator

I'm confused about this. We were able to see warnings in the logs previously, weren't we?

@dmnapolitano
Copy link
Contributor Author

I'm confused about this. We were able to see warnings in the logs previously, weren't we?

I don't think we were seeing them unless we explicitly did LOG.warn() or ran tox, which always shows them 🤔

Copy link
Collaborator

@lennybronner lennybronner left a comment

Choose a reason for hiding this comment

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

I see, that makes sense. thanks for finding.

@dmnapolitano
Copy link
Contributor Author

I see, that makes sense. thanks for finding.

Anytime! Logging is so annoying lol 😬

@dmnapolitano dmnapolitano merged commit 76019d0 into develop Dec 19, 2024
3 checks passed
@dmnapolitano dmnapolitano deleted the route-warnings-to-log branch December 19, 2024 16:35
@@ -18,7 +18,8 @@
"handlers": ["default"],
"level": "INFO",
"propagate": True,
}
},
"py.warnings": {"handlers": ["default"], "level": "INFO", "propigate": True},
Copy link

Choose a reason for hiding this comment

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

typo for propagate here

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.

3 participants