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-31060: Clean up some log message usage #17
Conversation
lsst.log supports both but logging prefers warning.
The latter is not supported by python logging.
@@ -328,7 +328,7 @@ def _solve(self, kernelCellSet, basisList): | |||
spatialSolution = spatialkv.getKernelSolution() | |||
except Exception as e: | |||
self.log.error("ERROR: Unable to calculate psf matching kernel") | |||
log.log("TRACE1." + self.log.getName() + "._solve", log.DEBUG, str(e)) | |||
log.log("TRACE1." + self.log.name + "._solve", log.DEBUG, str(e)) |
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.
Is this way of string concatenation fine?
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.
It is what is used in other place. The alternative would be:
log.log(f"TRACE1.{self.log.name}._solve", log.DEBUG, str(e))
or an alternative approach that might be more consistent with how other messages are logged:
log.getLogger(f"TRACE1.{self.log.name}._solve").debug("%s", e)
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.
I incorporated the second approach. The unit tests pass. Can I merge it without running Jenkins again? I'm not even sure if this line ever gets triggered anyway.
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.
Should be fine to merge.
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.
Looks great. Thanks for doing it.
No description provided.