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
This commit is contained in:
Gregory Szorc
2016-07-29 20:37:42 -07:00
parent 6bf4615173
commit 9aec4eb3a5

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()