From 67b94e0e2928fc55c4ff63073cd7e65e59938a42 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 6 Mar 2017 17:13:21 -0500 Subject: Add timestamps to debug logging. --- unit-tests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unit-tests.py b/unit-tests.py index e8743ed..bc7edf7 100644 --- a/unit-tests.py +++ b/unit-tests.py @@ -75,8 +75,13 @@ def main(): global args args = parse_arguments(argv[1:]) argv = argv[:1] + args.only_test - logging.basicConfig(level = logging.DEBUG if args.debug else logging.INFO) - unittest.main(verbosity = 1 if args.quiet else 2, argv = argv, catchbreak = True, testRunner = TextTestRunner) + logging.basicConfig(level = logging.DEBUG if args.debug else logging.INFO, + datefmt = "%Y-%m-%d %H:%M:%S", + format = "%(asctime)-15s %(name)s[%(process)d]:%(levelname)s: %(message)s",) + unittest.main(verbosity = 1 if args.quiet else 2, + argv = argv, + catchbreak = True, + testRunner = TextTestRunner) def parse_arguments(argv = ()): from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter -- cgit v1.2.3