bitbake: lib/bb/codeparser: ensure BufferedLogger respects target logging level

BufferedLogger was sending log records to the target logger without
checking if the logger is enabled for the level of the record - and
handle() doesn't check this either (it's normally checked earlier when
the relevant log function is called e.g. logger.debug()), leading for
example to debug messages from codeparser getting printed when the log
level for the main BitBake logger was set to logging.WARNING.

(Bitbake rev: 968a77388dd1a24c1dadec6ce49bf53ebb5b643f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2017-03-29 09:41:47 +13:00 committed by Richard Purdie
parent bb826208e5
commit 8b1826e78a
1 changed files with 2 additions and 1 deletions

View File

@ -186,7 +186,8 @@ class BufferedLogger(Logger):
def flush(self):
for record in self.buffer:
self.target.handle(record)
if self.target.isEnabledFor(record.levelno):
self.target.handle(record)
self.buffer = []
class PythonParser():