Bug 818649 - Ensure mach logs are written to log file; r=jhammel

DONTBUILD (NPOTB)
This commit is contained in:
Gregory Szorc 2012-12-07 11:44:11 -08:00
Родитель cc536f5aa8
Коммит b90f244f8b
1 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -112,11 +112,10 @@ class StructuredTerminalFormatter(StructuredHumanFormatter):
class LoggingManager(object): class LoggingManager(object):
"""Holds and controls global logging state. """Holds and controls global logging state.
A mozbuild application should instantiate one of these and configure it An application should instantiate one of these and configure it as needed.
as needed.
This class provides a mechanism to configure the output of logging data This class provides a mechanism to configure the output of logging data
both from mozbuild and from the overall logging system (e.g. from other both from mach and from the overall logging system (e.g. from other
modules). modules).
""" """
@ -135,12 +134,12 @@ class LoggingManager(object):
# complaining about "no handlers could be found for logger XXX." # complaining about "no handlers could be found for logger XXX."
self.root_logger.addHandler(logging.NullHandler()) self.root_logger.addHandler(logging.NullHandler())
self.mozbuild_logger = logging.getLogger('mozbuild') self.mach_logger = logging.getLogger('mach')
self.mozbuild_logger.setLevel(logging.DEBUG) self.mach_logger.setLevel(logging.DEBUG)
self.structured_filter = ConvertToStructuredFilter() self.structured_filter = ConvertToStructuredFilter()
self.structured_loggers = [self.mozbuild_logger] self.structured_loggers = [self.mach_logger]
self._terminal = None self._terminal = None
@ -227,6 +226,6 @@ class LoggingManager(object):
"""Register a structured logger. """Register a structured logger.
This needs to be called for all structured loggers that don't chain up This needs to be called for all structured loggers that don't chain up
to the mozbuild logger in order for their output to be captured. to the mach logger in order for their output to be captured.
""" """
self.structured_loggers.append(logger) self.structured_loggers.append(logger)