Bug 1045255 - Add back global logging setup removed in bug 886570 needed for leak logging on a CLOSED TREE.;r=gps
authorChris Manchester <cmanchester@mozilla.com>
Mon, 28 Jul 2014 19:51:55 -0400
changeset 196362 c4a45feb56705eefe2ae60a0069a4e4844f5ac64
parent 196361 75fe3b8f592c1e194b7a7d7a8fac319d21f5ae98
child 196363 56efa7ae8500bad30f4155d793bc1285614dcee2
child 196463 13009b32a504982690e8a2298d85ca03cda3ae46
child 196473 dd4ca4dd18c6decd76bc1d7af5055c5cf36ed96a
child 196505 fe9585ccbd5c1d11f62cb3d1864da41e5a206640
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersgps
bugs1045255, 886570
milestone34.0a1
Bug 1045255 - Add back global logging setup removed in bug 886570 needed for leak logging on a CLOSED TREE.;r=gps
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -42,16 +42,28 @@ from urllib import quote_plus as encodeU
 from mozlog.structured.formatters import TbplFormatter
 from mozlog.structured.handlers import StreamHandler
 from mozlog.structured.structuredlog import StructuredLogger
 
 # This should use the `which` module already in tree, but it is
 # not yet present in the mozharness environment
 from mozrunner.utils import findInPath as which
 
+
+# Necessary to set up the global logger in automationutils.py
+import logging
+log = logging.getLogger()
+def resetGlobalLog():
+   while log.handlers:
+       log.removeHandler(log.handlers[0])
+   handler = logging.StreamHandler(sys.stdout)
+   log.setLevel(logging.INFO)
+   log.addHandler(handler)
+resetGlobalLog()
+
 ###########################
 # Option for NSPR logging #
 ###########################
 
 # Set the desired log modules you want an NSPR log be produced by a try run for, or leave blank to disable the feature.
 # This will be passed to NSPR_LOG_MODULES environment variable. Try run will then put a download link for the log file
 # on tbpl.mozilla.org.