aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2015-06-09 18:33:36 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2015-06-09 18:33:36 +0300
commitcb9dde05f22933f3b959fad60483c0dd9fe18cb3 (patch)
treeeddeeb2a9e05a4c3b5955959a0ea38677a0df939
parenttest/toolkit.py: bugfix (diff)
downloadaes-tools-cb9dde05f22933f3b959fad60483c0dd9fe18cb3.tar.gz
aes-tools-cb9dde05f22933f3b959fad60483c0dd9fe18cb3.zip
test/800-38a.py: change default log file name
Diffstat (limited to '')
-rw-r--r--test/800-38a.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/800-38a.py b/test/800-38a.py
index 64a5cd0..4a785de 100644
--- a/test/800-38a.py
+++ b/test/800-38a.py
@@ -2,7 +2,10 @@
# This file is licensed under the terms of the MIT License.
# See LICENSE.txt for details.
-import toolkit, unittest
+from datetime import datetime
+import logging
+import toolkit
+import unittest
_plaintexts = ['6bc1bee22e409f96e93d7e117393172a',
'ae2d8a571e03ac9c9eb76fac45af8e51',
@@ -137,11 +140,13 @@ if __name__ == '__main__':
tools = toolkit.Tools(args.root, args.sde)
- import logging, logging.handlers
+ logging_options = {'format': '%(asctime)s | %(module)s | %(levelname)s | %(message)s',
+ 'level': logging.DEBUG}
if args.log is None:
- logging.getLogger().addHandler(logging.NullHandler())
+ logging_options['filename'] = datetime.now().strftime('800-38a_%Y-%m-%d_%H-%M-%S.log')
else:
- logging.basicConfig(filename=args.log, format='%(asctime)s | %(module)s | %(message)s', level=logging.DEBUG)
+ logging_options['filename'] = args.log
+ logging.basicConfig(**logging_options)
suite = unittest.TestSuite()
for algo in _ciphertexts: