Skip to content

Conversation

s-goldman
Copy link
Collaborator

@s-goldman s-goldman commented Aug 25, 2025

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

  • added entry in CHANGELOG.rst within the relevant release section
  • updated or added relevant tests
  • updated relevant documentation
  • added relevant label(s)

s-goldman and others added 28 commits March 12, 2025 15:00
@s-goldman s-goldman added the Do Not Merge PR which should not be merged label Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do Not Merge PR which should not be merged enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant