stdout logging configuration added
This commit is contained in:
parent
98fea3a4d4
commit
b9184d3e41
28
__init__.py
28
__init__.py
@ -151,9 +151,10 @@ class collectingTestcaseHandler(collectingHandler):
|
||||
self.MY_LOGS.append(record.__dict__)
|
||||
self.MY_LOGS[-1]['moduleLogger'] = collectingHandler().get_logs()
|
||||
|
||||
|
||||
def appLoggingConfigure(basepath, target, log_name_lvl=[], fmt=SHORT_FMT, ring_logs=None):
|
||||
target_handlers = ['main', 'logwarn']
|
||||
target_handlers = ['main', ]
|
||||
if basepath is not None:
|
||||
target_handlers.append('logwarn')
|
||||
# define handler
|
||||
#
|
||||
if target == 'stdout':
|
||||
@ -185,15 +186,16 @@ def appLoggingConfigure(basepath, target, log_name_lvl=[], fmt=SHORT_FMT, ring_l
|
||||
'class': 'report.collectingRingHandler',
|
||||
'max_logs': ring_logs,
|
||||
}
|
||||
handler['logwarn'] = {
|
||||
'level': 'WARNING',
|
||||
'formatter': 'long',
|
||||
'class': 'logging.handlers.RotatingFileHandler',
|
||||
'filename': os.path.join(basepath, 'messages.warn'),
|
||||
'mode': 'a',
|
||||
'maxBytes': 10485760,
|
||||
'backupCount': 2
|
||||
}
|
||||
if basepath is not None:
|
||||
handler['logwarn'] = {
|
||||
'level': 'WARNING',
|
||||
'formatter': 'long',
|
||||
'class': 'logging.handlers.RotatingFileHandler',
|
||||
'filename': os.path.join(basepath, 'messages.warn'),
|
||||
'mode': 'a',
|
||||
'maxBytes': 10485760,
|
||||
'backupCount': 2
|
||||
}
|
||||
# define loggers
|
||||
#
|
||||
loggers = {}
|
||||
@ -220,6 +222,10 @@ def appLoggingConfigure(basepath, target, log_name_lvl=[], fmt=SHORT_FMT, ring_l
|
||||
))
|
||||
|
||||
|
||||
def stdoutLoggingConfigure(log_name_lvl=[], fmt=SHORT_FMT):
|
||||
appLoggingConfigure(None, 'stdout', log_name_lvl=log_name_lvl, fmt=fmt)
|
||||
|
||||
|
||||
class testSession(dict):
|
||||
KEY_NAME = 'name'
|
||||
KEY_FAILED_TESTS = 'number_of_failed_tests'
|
||||
|
Loading…
x
Reference in New Issue
Block a user