Skip to content
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

Merged
merged 4 commits into from Jul 20, 2021

Conversation

arunkannawadi
Copy link
Member

No description provided.

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))
Copy link
Member Author

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?

Copy link
Member

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)

Copy link
Member Author

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.

Copy link
Member

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.

@arunkannawadi arunkannawadi requested a review from timj July 16, 2021 20:51
Copy link
Member

@timj timj left a 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.

@arunkannawadi arunkannawadi merged commit cb7397a into master Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants