зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8fd728e30375 (bug 1531234) for spidermonkey bustages on structuredlog.py . CLOSED TREE
This commit is contained in:
Родитель
78b674c7c4
Коммит
328eaa75ac
|
@ -1,8 +1,6 @@
|
|||
# produce mozlog-compatible log messages, following the spec at
|
||||
# https://mozbase.readthedocs.io/en/latest/mozlog.html
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
|
@ -16,8 +14,6 @@ class TestLogger(object):
|
|||
'thread': threadname,
|
||||
'pid': os.getpid(),
|
||||
}
|
||||
directory = os.environ.get("MOZ_UPLOAD_DIR", ".")
|
||||
self.fh = open(os.path.join(directory, threadname + "_raw.log"), "a")
|
||||
|
||||
def _record(self, **kwargs):
|
||||
record = self.template.copy()
|
||||
|
@ -27,7 +23,7 @@ class TestLogger(object):
|
|||
return record
|
||||
|
||||
def _log_obj(self, obj):
|
||||
print(json.dumps(obj, sort_keys=True), file=self.fh)
|
||||
print(json.dumps(obj, sort_keys=True))
|
||||
|
||||
def _log(self, **kwargs):
|
||||
self._log_obj(self._record(**kwargs))
|
||||
|
|
Загрузка…
Ссылка в новой задаче