From c30b84e6f3171557367d4eadb2cd0afc8ce9a0af Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 21 Feb 2017 15:20:09 -0800 Subject: Timestamp test logs --- tools/run_tests/python_utils/jobset.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py index 7b2c62d1a2..cd06f5e5fe 100755 --- a/tools/run_tests/python_utils/jobset.py +++ b/tools/run_tests/python_utils/jobset.py @@ -31,6 +31,7 @@ from __future__ import print_function +import logging import multiprocessing import os import platform @@ -128,7 +129,8 @@ _TAG_COLOR = { 'SKIPPED': 'cyan' } - +FORMAT = '%(asctime)-15s %(message)s' +logging.basicConfig(level=logging.INFO, format=FORMAT) def message(tag, msg, explanatory_text=None, do_newline=False): if message.old_tag == tag and message.old_msg == msg and not explanatory_text: return @@ -137,8 +139,8 @@ def message(tag, msg, explanatory_text=None, do_newline=False): try: if platform_string() == 'windows' or not sys.stdout.isatty(): if explanatory_text: - print(explanatory_text) - print('%s: %s' % (tag, msg)) + logging.info(explanatory_text) + logging.info('%s: %s', tag, msg) else: sys.stdout.write('%s%s%s\x1b[%d;%dm%s\x1b[0m: %s%s' % ( _BEGINNING_OF_LINE, -- cgit v1.2.3 From e6e7b017dd9bf1f63310a43305db749fb7408155 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 22 Feb 2017 17:13:53 -0800 Subject: PR comments --- tools/run_tests/python_utils/jobset.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py index cd06f5e5fe..f3047431e2 100755 --- a/tools/run_tests/python_utils/jobset.py +++ b/tools/run_tests/python_utils/jobset.py @@ -129,8 +129,9 @@ _TAG_COLOR = { 'SKIPPED': 'cyan' } -FORMAT = '%(asctime)-15s %(message)s' -logging.basicConfig(level=logging.INFO, format=FORMAT) +_FORMAT = '%(asctime)-15s %(message)s' +logging.basicConfig(level=logging.INFO, format=_FORMAT) + def message(tag, msg, explanatory_text=None, do_newline=False): if message.old_tag == tag and message.old_msg == msg and not explanatory_text: return -- cgit v1.2.3