Bug 1290620 - Make mach taskgraph honor mach logging settings; r=dustin

Before, it ignored mach logging settings passed via command line
arguments.

MozReview-Commit-ID: CNckQHrOdX9

--HG--
extra : rebase_source : b4b190e8e2d073e8932799c8d8bedf49b5f3cfd8
This commit is contained in:
Gregory Szorc 2016-07-29 20:37:42 -07:00
parent 526180e419
commit e2deca67fe

View File

@ -184,12 +184,15 @@ class MachCommands(MachCommandBase):
mach timestamp.
"""
# remove the old terminal handler
self.log_manager.replace_terminal_handler(None)
old = self.log_manager.replace_terminal_handler(None)
# re-add it, with level and fh set appropriately
if not quiet:
level = logging.DEBUG if verbose else logging.INFO
self.log_manager.add_terminal_logging(fh=sys.stderr, level=level)
self.log_manager.add_terminal_logging(
fh=sys.stderr, level=level,
write_interval=old.formatter.write_interval,
write_times=old.formatter.write_times)
# all of the taskgraph logging is unstructured logging
self.log_manager.enable_unstructured()