Bug 1043420 - Use actual log level in mochitest logs instead of always INFO. r=ted, a=test-only
authorAhmed Kachkach <ahmed.kachkach@gmail.com>
Thu, 24 Jul 2014 08:49:00 +0200
changeset 216361 ee1695fc5e0b98fd664a58ce7053fa4244ad01f4
parent 216360 dcec230e1104e21494b2365eef9dbba511d8a76e
child 216362 1e06f748a672c1b52fc896e934c0554da0dd87c7
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, test-only
bugs1043420
milestone33.0a2
Bug 1043420 - Use actual log level in mochitest logs instead of always INFO. r=ted, a=test-only
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -77,17 +77,18 @@ NSPR_LOG_MODULES = ""
 class MochitestFormatter(TbplFormatter):
     log_num = 0
 
     def __init__(self):
         super(MochitestFormatter, self).__init__()
 
     def __call__(self, data):
         tbpl_output = super(MochitestFormatter, self).__call__(data)
-        output = '%d INFO %s' % (MochitestFormatter.log_num, tbpl_output)
+        log_level = data.get('level', 'info').upper()
+        output = '%d %s %s' % (MochitestFormatter.log_num, log_level, tbpl_output)
         MochitestFormatter.log_num += 1
         return output
 
 ### output processing
 class MessageLogger(object):
     """File-like object for logging messages (structured logs)"""
     BUFFERING_THRESHOLD = 100
     # This is a delimiter used by the JS side to avoid logs interleaving