-
Notifications
You must be signed in to change notification settings - Fork 40
HLA-1526: Updated logging for runastrodriz #2064
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
Draft
s-goldman
wants to merge
38
commits into
spacetelescope:main
Choose a base branch
from
s-goldman:hla-705_align_log_levels_03_11_25
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
HLA-1526: Updated logging for runastrodriz #2064
s-goldman
wants to merge
38
commits into
spacetelescope:main
from
s-goldman:hla-705_align_log_levels_03_11_25
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…m/s-goldman/drizzlepac into hla-705_align_log_levels_03_11_25
Co-authored-by: mdlpstsci <[email protected]>
…la-705_align_log_levels_03_11_25
…la-705_align_log_levels_03_11_25
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves HLA-1526
Resolves HLA-705
Overview:
This PR updates the logging done in runastrodriz. Previously, logging was done by capturing print statements and piping them to specific trailer files. I have now tried to implement "python logging" for runastrodriz as well as several functions that it calls. A big reason for this push is that the text that is printed out when running drizzlepac is not the same as the text that is logged. In a number of cases, we have been unable to diagnose bugs because critical information only became available when looking at the printed output (as opposed to trailer files).
Reasoning for logging choices:
I opted to use a package-level logger instead of a root-level logger to avoid many of the unwanted lines from dependencies that we would not have the ability to filter out. Using a root logger also allows dependencies to change the running logging level which affects the lines logged in our module.
Related note:
Many other modules in drizzlepac use "python logging" with the util.WithLogging() class and so those do not need to be updated.
Lingering issues:
These changes reproduce the trailer file (when debug=True) to the best of my ability, however, some lines that were previously printed from dependencies (e.g. stwcs, tweakwcs) are no longer logged to the file. Additionally, I have also been unable to suppress logging lines from dependencies being printed. I've created a NullLogger for the root_logger in the init.py, however, it seems that it's being ignored.
Checklist for maintainers
CHANGELOG.rst
within the relevant release section