Backed out changeset 8fd728e30375 (bug 1531234) for spidermonkey bustages on structuredlog.py . CLOSED TREE

This commit is contained in:
Narcis Beleuzu 2019-03-01 03:31:10 +02:00
Родитель 78b674c7c4
Коммит 328eaa75ac
1 изменённых файлов: 1 добавлений и 5 удалений

Просмотреть файл

@ -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))