aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar David G. Quintas <dgq@google.com>2017-02-28 14:51:17 -0800
committerGravatar GitHub <noreply@github.com>2017-02-28 14:51:17 -0800
commit16edd99975462719110c0203108f6b5f9aaeb669 (patch)
treef02fb31650451c823f7153bc9cc4e380c534d901 /tools
parent9ccebc3a459cd6783a6d219c1f734308eb6e822a (diff)
parente6e7b017dd9bf1f63310a43305db749fb7408155 (diff)
Merge pull request #9812 from dgquintas/timestamp_logs
Timestamp test logs
Diffstat (limited to 'tools')
-rwxr-xr-xtools/run_tests/python_utils/jobset.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py
index 7b2c62d1a2..f3047431e2 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,6 +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:
@@ -137,8 +140,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,