Bug 1344346 - [mozlog] Use less verbose formatting on 'process_output' messages, r=jgraham
☠☠ backed out by c593315237b8 ☠ ☠
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Mon, 06 Mar 2017 13:20:25 -0500
changeset 346868 71e3443cdc4355ed59ea0ae565cbdb42da4c3236
parent 346867 cd8993e4d0dd9b4ae7d7bc7f48a5119d0cbd416d
child 346869 9646ef87ae12aa5f605c5f8587d3805b3f95b5eb
push id31480
push usercbook@mozilla.com
push dateFri, 10 Mar 2017 10:37:06 +0000
treeherdermozilla-central@e18d3dd20e8d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1344346
milestone55.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 1344346 - [mozlog] Use less verbose formatting on 'process_output' messages, r=jgraham This simplifies the 'process_output' formatting in both the mach and tbpl formatters. It will also add the string 'pid' somewhere in the format, but only if the process id is actually a positive int. MozReview-Commit-ID: 6nc5q06cDfM
testing/mozbase/mozlog/mozlog/formatters/machformatter.py
testing/mozbase/mozlog/mozlog/formatters/tbplformatter.py
--- a/testing/mozbase/mozlog/mozlog/formatters/machformatter.py
+++ b/testing/mozbase/mozlog/mozlog/formatters/machformatter.py
@@ -317,21 +317,25 @@ class MachFormatter(base.BaseFormatter):
         elif data["status"] == "SKIP":
             self.summary_values["skipped"] += 1
         else:
             self.summary_values["expected"] += 1
 
     def process_output(self, data):
         rv = []
 
+        pid = data['process']
+        if pid.isdigit():
+            pid = 'pid:%s' % pid
+
         if "command" in data and data["process"] not in self._known_pids:
             self._known_pids.add(data["process"])
-            rv.append('(pid:%s) Full command: %s' % (data["process"], data["command"]))
+            rv.append('(%s) Full command: %s' % (pid, data["command"]))
 
-        rv.append('(pid:%s) "%s"' % (data["process"], data["data"]))
+        rv.append('(%s) "%s"' % (pid, data["data"]))
         return "\n".join(rv)
 
     def crash(self, data):
         test = self._get_test_id(data)
 
         if data.get("stackwalk_returncode", 0) != 0 and not data.get("stackwalk_stderr"):
             success = True
         else:
--- a/testing/mozbase/mozlog/mozlog/formatters/tbplformatter.py
+++ b/testing/mozbase/mozlog/mozlog/formatters/tbplformatter.py
@@ -67,17 +67,20 @@ class TbplFormatter(BaseFormatter):
 
         if "stack" in data:
             message += "\n%s" % data["stack"]
 
         return "%s\n" % message
 
     @output_subtests
     def process_output(self, data):
-        return "PROCESS | %(process)s | %(data)s\n" % data
+        pid = data['process']
+        if pid.isdigit():
+            pid = 'PID %s' % pid
+        return "%s | %s\n" % (pid, data['data'])
 
     @output_subtests
     def process_start(self, data):
         msg = "TEST-INFO | started process %s" % data['process']
         if 'command' in data:
             msg = '%s (%s)' % (msg, data['command'])
         return msg + '\n'