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

Standardize logging initialization #337

Merged
merged 2 commits into from
Oct 20, 2023
Merged

Standardize logging initialization #337

merged 2 commits into from
Oct 20, 2023

Conversation

song-william
Copy link
Collaborator

@song-william song-william commented Oct 20, 2023

The python standard seems to be logging.getLogger(__name__). Using make_logger(logger_name()) is our analgous version. logger_name() is just a utility over __name__ that gracefully handles the edge case with __main__.

We previously had many different ways of initing the logger

logger = make_logger(logger_name())
logger = make_logger(filename_wo_ext(__file__))
logger = make_logger(filename_wo_ext(__name__))
logger = make_logger(__name__)

@song-william song-william enabled auto-merge (squash) October 20, 2023 01:45
@song-william song-william merged commit 38caaa6 into main Oct 20, 2023
5 checks passed
@song-william song-william deleted the wsong/unify-logging branch October 20, 2023 02:10
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