mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 22:55:23 +00:00
Backed out changeset 7dcc83c574ed (bug 1050700) by request; CLOSED TREE DONTBUILD
This commit is contained in:
parent
85253ec496
commit
e8575c8a04
@ -247,14 +247,9 @@ class MachFormatter(base.BaseFormatter):
|
||||
level = self.terminal.blue(level)
|
||||
|
||||
if data.get('component'):
|
||||
rv = " ".join([data["component"], level, data["message"]])
|
||||
else:
|
||||
rv = "%s %s" % (level, message)
|
||||
return " ".join([data["component"], level, data["message"]])
|
||||
|
||||
if "stack" in data:
|
||||
rv += "\n%s" % data["stack"]
|
||||
|
||||
return rv
|
||||
return "%s %s" % (level, data["message"])
|
||||
|
||||
def _get_subtest_data(self, data):
|
||||
test = self._get_test_id(data)
|
||||
|
@ -18,14 +18,9 @@ class TbplFormatter(BaseFormatter):
|
||||
|
||||
def log(self, data):
|
||||
if data.get('component'):
|
||||
message = "%s %s" % (data["component"], data["message"])
|
||||
else:
|
||||
message = data["message"]
|
||||
return "%s %s\n" % (data["component"], data["message"])
|
||||
|
||||
if "stack" in data:
|
||||
message += "\n%s" % data["stack"]
|
||||
|
||||
return "%s\n" % message
|
||||
return "%s\n" % (data["message"])
|
||||
|
||||
def process_output(self, data):
|
||||
return "PROCESS | %(process)s | %(data)s\n" % data
|
||||
|
@ -165,7 +165,3 @@ class List(DataType):
|
||||
class Int(DataType):
|
||||
def convert(self, data):
|
||||
return int(data)
|
||||
|
||||
class Any(DataType):
|
||||
def convert(self, data):
|
||||
return data
|
||||
|
@ -7,11 +7,9 @@ from __future__ import unicode_literals
|
||||
from multiprocessing import current_process
|
||||
from threading import current_thread, Lock
|
||||
import json
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
|
||||
from logtypes import Unicode, TestId, Status, SubStatus, Dict, List, Any, log_action, convertor_registry
|
||||
from logtypes import Unicode, TestId, Status, SubStatus, Dict, List, log_action, convertor_registry
|
||||
|
||||
"""Structured Logging for recording test results.
|
||||
|
||||
@ -299,27 +297,14 @@ class StructuredLogger(object):
|
||||
|
||||
|
||||
def _log_func(level_name):
|
||||
@log_action(Unicode("message"),
|
||||
Any("exc_info", default=False))
|
||||
@log_action(Unicode("message"))
|
||||
def log(self, data):
|
||||
exc_info = data.pop("exc_info", None)
|
||||
if exc_info:
|
||||
if not isinstance(exc_info, tuple):
|
||||
exc_info = sys.exc_info()
|
||||
if exc_info != (None, None, None):
|
||||
bt = traceback.format_exception(*exc_info)
|
||||
data["stack"] = u"\n".join(bt)
|
||||
|
||||
data["level"] = level_name
|
||||
self._log_data("log", data)
|
||||
|
||||
log.__doc__ = """Log a message with level %s
|
||||
|
||||
:param message: The string message to log
|
||||
:param exc_info: Either a boolean indicating whether to include a traceback
|
||||
derived from sys.exc_info() or a three-item tuple in the
|
||||
same format as sys.exc_info() containing exception information
|
||||
to log.
|
||||
""" % level_name
|
||||
log.__name__ = str(level_name).lower()
|
||||
return log
|
||||
|
Loading…
Reference in New Issue
Block a user