Improve binding of loud.

This commit is contained in:
Ethan Dalool 2020-11-09 16:31:19 -08:00
parent cf4b670f43
commit 2cbb93386e

View file

@ -10,8 +10,12 @@ def getLogger(*args, **kwargs):
return log return log
def add_loud(log): def add_loud(log):
def loud(self, message, *args, **kwargs):
if self.isEnabledFor(LOUD):
self._log(LOUD, message, args, **kwargs)
addLevelName(LOUD, 'LOUD') addLevelName(LOUD, 'LOUD')
log.loud = lambda *args, **kwargs: log.log(LOUD, *args, **kwargs) log.loud = loud.__get__(log, log.__class__)
def get_level_by_argv(argv): def get_level_by_argv(argv):
''' '''