From 2cbb93386eff0daebdaf06c654e971ae6a709a3f Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 9 Nov 2020 16:31:19 -0800 Subject: [PATCH] Improve binding of loud. --- voussoirkit/vlogging.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/voussoirkit/vlogging.py b/voussoirkit/vlogging.py index 54576bd..780c40a 100644 --- a/voussoirkit/vlogging.py +++ b/voussoirkit/vlogging.py @@ -10,8 +10,12 @@ def getLogger(*args, **kwargs): return log def add_loud(log): + def loud(self, message, *args, **kwargs): + if self.isEnabledFor(LOUD): + self._log(LOUD, message, args, **kwargs) + 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): '''