Bug 1448149 [wpt PR 10148] - Do not print logs twice when running wpt lint, a=testonly
authorBrendan McLoughlin <bmac@users.noreply.github.com>
Wed, 25 Apr 2018 18:58:44 +0000
changeset 471893 3437d8dffc5b7abda751a5aa389ff07988ab26e7
parent 471892 dca90afc00ae4724896b7a4c36ec479aacec6462
child 471894 eb958bce163db24354bf380f60dbd35107c26e8a
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1448149, 10148
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1448149 [wpt PR 10148] - Do not print logs twice when running wpt lint, a=testonly Automatic update from web-platform-testsDo not print logs twice when running wpt lint (#10148) -- wpt-commits: 16e3f3e541348400009edc7d296aba34b4961aff wpt-pr: 10148
testing/web-platform/tests/tools/lint/lint.py
--- a/testing/web-platform/tests/tools/lint/lint.py
+++ b/testing/web-platform/tests/tools/lint/lint.py
@@ -27,17 +27,20 @@ import logging
 
 logger = None
 
 def setup_logging(prefix=False):
     global logger
     if logger is None:
         logger = logging.getLogger(os.path.basename(os.path.splitext(__file__)[0]))
         handler = logging.StreamHandler(sys.stdout)
-        logger.addHandler(handler)
+        # Only add a handler if the parent logger is missing a handler
+        if logger.parent and len(logger.parent.handlers) == 0:
+            handler = logging.StreamHandler(sys.stdout)
+            logger.addHandler(handler)
     if prefix:
         format = logging.BASIC_FORMAT
     else:
         format = "%(message)s"
     formatter = logging.Formatter(format)
     for handler in logger.handlers:
         handler.setFormatter(formatter)
     logger.setLevel(logging.DEBUG)