Add snake_case alias get_logger, getLogger.
This commit is contained in:
parent
ea08e2399e
commit
7d9489b5ae
1 changed files with 4 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue