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-31801: Prepend Task loggers with "lsst" #208

Merged
merged 2 commits into from Nov 11, 2021
Merged

DM-31801: Prepend Task loggers with "lsst" #208

merged 2 commits into from Nov 11, 2021

Conversation

timj
Copy link
Member

@timj timj commented Oct 8, 2021

This allows all Task loggers by default to be in the same logger hierarchy.

The code does not hard-code "lsst" but determines the prefix from the Task __module__ name.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@timj timj requested a review from erykoff October 9, 2021 00:00
@timj
Copy link
Member Author

timj commented Oct 9, 2021

@erykoff I'd appreciate your thoughts on this change to automatically prepend (effectivel) "lsst." to task loggers. I'm being careful not to force "lsst" as a prefix on every Task because I'm cognizant of people outside of LSST writing their own Tasks. They could of course set the class property to False to disable it but it seems reasonable to work it out ourselves.

Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a typo, but otherwise I don't know anything about python loggers and have no strong opinions on them other than I want them to be easy to set up.

python/lsst/pipe/base/task.py Outdated Show resolved Hide resolved
@timj timj force-pushed the tickets/DM-31801 branch 3 times, most recently from f4118be to 78ec84f Compare November 8, 2021 16:39
@timj timj requested a review from ktlim November 10, 2021 16:07
python/lsst/pipe/base/task.py Show resolved Hide resolved
Rather than having to edit every single task to specify a module
prefix, determing the module prefix automatically (usually "lsst")
and prepend it if the logger name is being determined
automatically.

Provide a flag to disable this such that specific Task implementations
can declare that the default name should be used on its own.
@timj timj merged commit 750a0b1 into master Nov 11, 2021
@timj timj deleted the tickets/DM-31801 branch November 11, 2021 00:25
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

3 participants