From dc49c33546174ca69d6c3534fd53466d2e212af3 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 16 Jan 2019 20:27:53 +0000 Subject: [PATCH] Bug 1520394 - Restore logging to file after running old-configure. r=nalexander We're going to want to log some more. At the moment, this just adds the output of subconfigure to top-level config.log, but this will become more useful down the road. Depends on D16665 Differential Revision: https://phabricator.services.mozilla.com/D16666 --HG-- extra : moz-landing-system : lando --- build/moz.configure/old.configure | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 8670a709d49e..7375ea382d77 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -322,12 +322,12 @@ def old_configure(prepare_configure, prepare_configure_options): ' '.join('%s=%s' % pair for pair in extra_env.iteritems())) # Our logging goes to config.log, the same file old.configure uses. - # We can't share the handle on the file, so close it. We assume nothing - # beyond this point is going to be interesting to log to config.log from - # our end, so we don't make the effort to recreate a logging.FileHandler. + # We can't share the handle on the file, so close it. logger = logging.getLogger('moz.configure') + config_log = None for handler in logger.handlers: if isinstance(handler, logging.FileHandler): + config_log = handler handler.close() logger.removeHandler(handler) @@ -351,6 +351,12 @@ def old_configure(prepare_configure, prepare_configure_options): log.error('old-configure failed') sys.exit(ret) + if config_log: + # Create a new handler in append mode + handler = logging.FileHandler(config_log.baseFilename, mode='a', delay=True) + handler.setFormatter(config_log.formatter) + logger.addHandler(handler) + raw_config = { 'split': split, 'unique_list': unique_list,