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
DM-6999: Logging framework migration #11
Conversation
The code changes all look fine. Could you add to the commit message the ticket number that will remove pexLog permanently? |
With the logging framework changes in pipe_base, Tasks' logs is transitioned from pex.logging to lsst.log, and negative logging levels are no longer used. To facilitate logging framework migration, usage of pexLog.Debug is separated. Practically this commit reverts part of the changes in 33520d7
4807c68
to
739d91e
Compare
@@ -154,6 +155,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None): | |||
normalizeResiduals = lsstDebug.Info(__name__).normalizeResiduals | |||
# Normalise residuals by object amplitude | |||
|
|||
debugLog = pexLog.Debug("meas.algorithms.psfDeterminer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add this debug log? This task already has a log attribute and the existing code used it.
The old trace/debug level of 1 was used as a warning. Replace it by logging it to the WARN level.
778b353
to
da599c6
Compare
@r-owen Originally I thought this was a special case so I made it use |
I'll have a look. I also posted a table of old vs new log levels to DM-6999 as a comment |
@@ -186,8 +186,7 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None): | |||
sizes[i] = rmsSize | |||
|
|||
if self.config.kernelSize >= 15: | |||
debugLog.debug(1, \ | |||
"WARNING: NOT scaling kernelSize by stellar quadrupole moment, but using absolute value") | |||
self.log.warn("NOT scaling kernelSize by stellar quadrupole moment, but using absolute value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a sensible change to me
I'm not an expert on the code in question, but your changes look reasonable to me. I suspect many more such decisions will be required due to lack of trace levels in the log package. |
Change back to use pexLog.Debug directly to facilitate logging framework migration