All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Follow-up fix for tinfoil series
@ 2017-03-28 20:41 Paul Eggleton
  2017-03-28 20:41 ` [PATCH v2 1/1] lib/bb/codeparser: ensure BufferedLogger respects target logging level Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2017-03-28 20:41 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Christopher Larson

This resolves the minor regression that caused a few debug messages
to get printed after recent bitbake commit
824e73e0f3eaa96b4d84da7e31f9a17ce5c5d7ee.

Changes since v1:
 - It's not about filtering, and calling filter() just checks if the
   record should be filtered out or not (which handle() already does),
   we need to explicitly check whether the target logger is enabled
   for the level of the record. Thanks to Chris Larson for pointing
   this out.


The following changes since commit 921592026c69287cdb40ffd90944d5944f28e2c3:

  main: Improve -v and -D option documentation (2017-03-27 11:11:05 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib paule/codeparser-log
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/codeparser-log

Paul Eggleton (1):
  lib/bb/codeparser: ensure BufferedLogger respects target logging level

 lib/bb/codeparser.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.9.3



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v2 1/1] lib/bb/codeparser: ensure BufferedLogger respects target logging level
  2017-03-28 20:41 [PATCH v2 0/1] Follow-up fix for tinfoil series Paul Eggleton
@ 2017-03-28 20:41 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2017-03-28 20:41 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Christopher Larson

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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/codeparser.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bb/codeparser.py b/lib/bb/codeparser.py
index 5d2d440..89d24ab 100644
--- a/lib/bb/codeparser.py
+++ b/lib/bb/codeparser.py
@@ -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():
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-28 20:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28 20:41 [PATCH v2 0/1] Follow-up fix for tinfoil series Paul Eggleton
2017-03-28 20:41 ` [PATCH v2 1/1] lib/bb/codeparser: ensure BufferedLogger respects target logging level Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.