[oe-commits] [bitbake] 11/17: tinfoil: fix log message doubling when config_only=False

git at git.openembedded.org git at git.openembedded.org
Thu Aug 31 16:56:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit b5e3b28b7c982dd8a3991d727f25710dbf58bb80
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Aug 31 11:30:43 2017 +1200

    tinfoil: fix log message doubling when config_only=False
    
    With config_only=False we launch the UI and it sets up a logger, whereas
    when config_only=True we don't, with the result that with True we are
    seeing log messages from both our logger and the one set up by the UI.
    Suppress our loggers with config_only=True to avoid this.
    
    Fixes [YOCTO #11275] (again).
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/tinfoil.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index cd0587e..fd17edc 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -325,7 +325,12 @@ class Tinfoil:
         if setup_logging:
             # This is the *client-side* logger, nothing to do with
             # logging messages from the server
+            oldhandlers = self.logger.handlers[:]
             bb.msg.logger_create('BitBake', output)
+            self.localhandlers = []
+            for handler in self.logger.handlers:
+                if handler not in oldhandlers:
+                    self.localhandlers.append(handler)
 
     def __enter__(self):
         return self
@@ -381,6 +386,12 @@ class Tinfoil:
         cookerconfig = CookerConfiguration()
         cookerconfig.setConfigParameters(config_params)
 
+        if not config_only:
+            # Disable local loggers because the UI module is going to set up its own
+            for handler in self.localhandlers:
+                self.logger.handlers.remove(handler)
+            self.localhandlers = []
+
         self.server_connection, ui_module = setup_bitbake(config_params,
                             cookerconfig,
                             extrafeatures)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list