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-45131: Use LsstLogAdapter for logger and document it as an option #100

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

timj
Copy link
Member

@timj timj commented Jul 5, 2024

No description provided.

import lsst.log as lsstLog

log = lsstLog.Log.getLogger(__name__)
log = lsst.utils.logging.getLogger(__name__)

if verbose:
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 retained the logic where verbose is only used if log is None. That might not be intentional but it is what was implemented before. The logger is reset if verbose is not set because (1) by default it's WARNING and (2) otherwise calling this with verbose True and then False would leave the trace logger set.

Copy link
Contributor

@fred3m fred3m left a comment

Choose a reason for hiding this comment

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

LGTM. TBH I'm not sure we even need to pass log as an argument anymore. It thinks it's an artifact of the code many moons ago, long before I was on the project. So feel free to completely strip out this logic entirely if you want, or just leave it as is to minimize the work needed to finish DM-45131.

Also modify the documentation to note that a default logger
is created rather than disabling logging and that verbose
only affects that default logger.
@timj timj force-pushed the tickets/DM-45131 branch from 0ca479f to 5204d16 Compare July 8, 2024 16:25
@timj timj merged commit 8cd86fa into main Jul 8, 2024
2 checks passed
@timj timj deleted the tickets/DM-45131 branch July 8, 2024 23:01
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.

3 participants