From 7d9489b5aead66dcc9ae1ef5012569d41811fc60 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 24 Oct 2021 23:34:08 -0700 Subject: [PATCH] Add snake_case alias get_logger, getLogger. --- voussoirkit/vlogging.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/voussoirkit/vlogging.py b/voussoirkit/vlogging.py index 83f26fd..281fdc8 100644 --- a/voussoirkit/vlogging.py +++ b/voussoirkit/vlogging.py @@ -24,9 +24,9 @@ root.setLevel(NOTSET) LOUD = 1 SILENT = 99999999999 -def getLogger(name=None, main_fallback=None): +def get_logger(name=None, main_fallback=None): ''' - Normally it is best practice to use getLogger(__name__), but when running + Normally it is best practice to use get_logger(__name__), but when running a script directly you'll see "__main__" in the output, which I think is ugly and unexpected for anyone who doesn't know what's going on behind the scenes. But hardcoding your logger name is not good either. @@ -38,6 +38,8 @@ def getLogger(name=None, main_fallback=None): add_loud(log) return log +getLogger = get_logger + def add_loud(log): ''' Add the `loud` method to the given logger.