[bitbake-devel] [PATCH 1/2] event: Ensure we clean up loggers

Richard Purdie richard.purdie at linuxfoundation.org
Thu Nov 9 11:56:07 UTC 2017


Whilst we're likely exiting in this case, clean up the loggers we add
so that in the case of certain server retries there is no possibility
multiple loggers stack up.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/event.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bb/event.py b/lib/bb/event.py
index 526c41f..52072b5 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -173,6 +173,10 @@ def print_ui_queue():
             for event in ui_queue[:]:
                 if isinstance(event, logging.LogRecord):
                     logger.handle(event)
+        if msgerrs:
+            logger.removeHandler(stderr)
+        else:
+            logger.removeHandler(stdout)
 
 def fire_ui_handlers(event, d):
     global _thread_lock
-- 
2.7.4




More information about the bitbake-devel mailing list