Bug 1041533 - Update mozdevice to not reset global log level. r=armenzg

This commit is contained in:
William Lachance 2014-07-23 10:31:43 -04:00
parent 73feaea36c
commit 65c9e515b2

View File

@ -46,12 +46,13 @@ class DeviceManager(object):
_logcatNeedsRoot = True
def __init__(self, logLevel=mozlog.ERROR, deviceRoot=None):
def __init__(self, logLevel=None, deviceRoot=None):
try:
self._logger = mozlog.structured.structuredlog.get_default_logger(component="mozdevice")
if not self._logger: # no global structured logger, fall back to reg logging
self._logger = mozlog.getLogger("mozdevice")
self._logger.setLevel(logLevel)
if logLevel is not None:
self._logger.setLevel(logLevel)
except AttributeError:
# Structured logging doesn't work on Python 2.6
self._logger = None