WIP: Refactor stpipe logging#238
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #238 +/- ##
==========================================
- Coverage 95.34% 93.64% -1.71%
==========================================
Files 37 37
Lines 3414 3271 -143
==========================================
- Hits 3255 3063 -192
- Misses 159 208 +49 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
910eef8 to
f678d58
Compare
|
I will close this prototype PR to start fresh from the current state in stpipe, following the merge of #240. From various discussions, it sounds like there is a strong desire to make sure the standard convention of getting a local logger with There is also significant concern about the impact on downstream packages, so I will prioritize incremental improvements and appropriate deprecations in the next version. |
Resolves JP-1866
Resolves JP-4008
Resolves RCAL-nnnn
Draft proposal to simplify and consolidate logging under a single "stpipe" root logger.
This will need discussion and coordination across romancal and jwst teams, as it is currently a breaking change. To demonstrate the changes needed, I filed draft PRs for jwst, stdatamodels, and stcal here:
spacetelescope/jwst#9547
spacetelescope/stdatamodels#499
spacetelescope/stcal#377
If we like this proposal, these repositories will also need similar changes before this PR can be merged:
romancal
roman_datamodels
Note:
I intended this PR to be a platform for discussion for the logging refactor, but there are a couple other concurrent ideas about logging and it’s not clear at this point if the work will continue here or elsewhere.
In case it helps the discussion or future work, these are the design principles I was working toward here.
Goal: align ST calibration pipeline logging with Python best practices
Principles:
logcfgarguments to command line and call/run.callfunction, the default option to add a stream handler should not override any previous configuration set by the user.The last principle I think is optional, but I felt would be nice for maximum utility to users. If all cal packages agree to log to the same parent log name, then all a user needs to do to configure all logs from all our complex interdependent packages is to set it up once on the "stpipe" parent log. If it is objectionable to log to an stpipe logger from a non-stpipe package, we could all agree on a different parent name, e.g. "stlog" – the actual name of the log is arbitrary. Alternately, if we do not want to have all packages log to the same logger, we could also consider white-listing known log names, either through entry points or some other configuration local to the jwst and romancal packages, so that stpipe knows which ones it should handle. The option implemented here is currently the simplest one: stpipe configures only one log, called "stpipe".
Tasks
docs/pageno-changelog-entry-needed)changes/:echo "changed something" > changes/<PR#>.<changetype>.rst(see below for change types)"git+https://github.com/<fork>/stpipe@<branch>")jwstregression testromancalregression testnews fragment change types...
changes/<PR#>.feature.rst: new featurechanges/<PR#>.bugfix.rst: fixes an issuechanges/<PR#>.doc.rst: documentation changechanges/<PR#>.removal.rst: deprecation or removal of public APIchanges/<PR#>.misc.rst: infrastructure or miscellaneous change