diff options
author | Rob Austein <sra@hactrn.net> | 2017-03-06 17:13:21 -0500 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2017-03-06 17:13:21 -0500 |
commit | 67b94e0e2928fc55c4ff63073cd7e65e59938a42 (patch) | |
tree | fa394572952c6a1b5beba64f6e3cb13ca389830e /unit-tests.py | |
parent | 72bddf4f2e7e711abd0df7bf71e0e653a090b899 (diff) |
Add timestamps to debug logging.
Diffstat (limited to 'unit-tests.py')
-rw-r--r-- | unit-tests.py | 9 |
1 files 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 |