Commit 128ce68b authored by Petr Špaček's avatar Petr Špaček

Deckard: print log results using logging module

parent d7efc339
......@@ -2,6 +2,7 @@
from __future__ import print_function
import logging
import logging.config
import argparse
import sys
import os
......@@ -316,7 +317,15 @@ if __name__ == '__main__':
setattr(namespace, self.dest, values)
test_platform()
logging.basicConfig(level=logging.ERROR)
logging.basicConfig(level=logging.ERROR, format='%(message)s')
logging.config.dictConfig(
{
'version': 1,
'incremental': True,
'loggers': {
'pydnstest.test.Test': {'level': 'INFO'}
}
})
log = logging.getLogger('deckard')
argparser = argparse.ArgumentParser()
......
#!/usr/bin/env python
import logging
import os
import traceback
import time
class Test:
""" Small library to imitate CMocka output. """
log = logging.getLogger('pydnstest.test.Test')
def __init__(self):
self.tests = []
......@@ -25,10 +26,10 @@ class Test:
try:
test_callback(name, args)
passed += 1
print('[ OK ] %s' % name)
self.log.info('[ OK ] %s', name)
except Exception as e:
print('[ FAIL ] %s (%s)' % (name, str(e)))
print(traceback.format_exc())
self.log.error('[ FAIL ] %s', name)
self.log.exception(e)
# Clear test set
self.tests = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment