Skip to content

Standardize logging initialization#337

Merged
song-william merged 2 commits intomainfrom
wsong/unify-logging
Oct 20, 2023
Merged

Standardize logging initialization#337
song-william merged 2 commits intomainfrom
wsong/unify-logging

Conversation

@song-william
Copy link
Copy Markdown
Contributor

@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
@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.

3 participants