Bug 1415614 - Don't assign mach logger to instance variable; r=nalexander draft
authorGregory Szorc <gps@mozilla.com>
Wed, 08 Nov 2017 14:28:19 -0800
changeset 695703 dca383e5f5b770fa3adb09d753897633258302a1
parent 695600 2bdf6eed0f64a51dfe099e089852533595f1a896
child 695704 c0dac24e84aefe056370ea83421ff0b30fa2b713
child 695860 f50dbbe024e50dfc2d3ea4a46c328ef753e6bab6
push id88508
push userbmo:gps@mozilla.com
push dateThu, 09 Nov 2017 17:59:41 +0000
reviewersnalexander
bugs1415614
milestone58.0a1
Bug 1415614 - Don't assign mach logger to instance variable; r=nalexander We don't use this attribute outside of this function. Besides, you can easily obtain a handle on the logger by calling ``logging.getLogger('mach')``. MozReview-Commit-ID: 41vdn6McowW
python/mach/mach/logging.py
--- a/python/mach/mach/logging.py
+++ b/python/mach/mach/logging.py
@@ -156,22 +156,22 @@ class LoggingManager(object):
         self.root_logger = logging.getLogger()
         self.root_logger.setLevel(logging.DEBUG)
 
         # Installing NullHandler on the root logger ensures that *all* log
         # messages have at least one handler. This prevents Python from
         # complaining about "no handlers could be found for logger XXX."
         self.root_logger.addHandler(logging.NullHandler())
 
-        self.mach_logger = logging.getLogger('mach')
-        self.mach_logger.setLevel(logging.DEBUG)
+        mach_logger = logging.getLogger('mach')
+        mach_logger.setLevel(logging.DEBUG)
 
         self.structured_filter = ConvertToStructuredFilter()
 
-        self.structured_loggers = [self.mach_logger]
+        self.structured_loggers = [mach_logger]
 
         self._terminal = None
 
     @property
     def terminal(self):
         if not self._terminal and blessings:
             # Sometimes blessings fails to set up the terminal. In that case,
             # silently fail.