Bug 1045255 - Add back global logging setup removed in bug 886570 needed for leak logging on a CLOSED TREE.;r=gps a=test-only
authorChris Manchester <cmanchester@mozilla.com>
Mon, 28 Jul 2014 19:51:55 -0400
changeset 217282 1ceea59bf3e22af793bcbc8460e428e0dd529993
parent 217281 b0e2cd20d9471be57e38490886ca9795299c8c70
child 217283 78609057e416bdd217b3ac93750a3f5e890a6e2e
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, test-only
bugs1045255, 886570
milestone33.0a2
Bug 1045255 - Add back global logging setup removed in bug 886570 needed for leak logging on a CLOSED TREE.;r=gps a=test-only
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.