summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tinfoil.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-08-31 11:30:43 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-31 23:30:03 +0100
commit6ef0a567706be050c65efcebf444510c0969ce89 (patch)
treed4e9da518ba826ad65706a0385b0d0b032b840bd /bitbake/lib/bb/tinfoil.py
parente2ca45646eed986b9b0a965110b7771cfbc26710 (diff)
downloadpoky-6ef0a567706be050c65efcebf444510c0969ce89.tar.gz
bitbake: 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). (Bitbake rev: b5e3b28b7c982dd8a3991d727f25710dbf58bb80) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tinfoil.py')
-rw-r--r--bitbake/lib/bb/tinfoil.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index cd0587e277..fd17edcc58 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -325,7 +325,12 @@ class Tinfoil:
325 if setup_logging: 325 if setup_logging:
326 # This is the *client-side* logger, nothing to do with 326 # This is the *client-side* logger, nothing to do with
327 # logging messages from the server 327 # logging messages from the server
328 oldhandlers = self.logger.handlers[:]
328 bb.msg.logger_create('BitBake', output) 329 bb.msg.logger_create('BitBake', output)
330 self.localhandlers = []
331 for handler in self.logger.handlers:
332 if handler not in oldhandlers:
333 self.localhandlers.append(handler)
329 334
330 def __enter__(self): 335 def __enter__(self):
331 return self 336 return self
@@ -381,6 +386,12 @@ class Tinfoil:
381 cookerconfig = CookerConfiguration() 386 cookerconfig = CookerConfiguration()
382 cookerconfig.setConfigParameters(config_params) 387 cookerconfig.setConfigParameters(config_params)
383 388
389 if not config_only:
390 # Disable local loggers because the UI module is going to set up its own
391 for handler in self.localhandlers:
392 self.logger.handlers.remove(handler)
393 self.localhandlers = []
394
384 self.server_connection, ui_module = setup_bitbake(config_params, 395 self.server_connection, ui_module = setup_bitbake(config_params,
385 cookerconfig, 396 cookerconfig,
386 extrafeatures) 397 extrafeatures)