Add debugstdout flag/config-directive
to enable debug logging to stdout Fix #15
This commit is contained in:
parent
0033ce186f
commit
8f49c3e95d
|
@ -40,6 +40,10 @@ def cli():
|
|||
'-d', '--debug',
|
||||
help='debug mode', action='store_true'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-ds', '--debugstdout',
|
||||
help='write debug output to stdout', action='store_true'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-nod', '--noonlinedc',
|
||||
help='don\'t add connect until now to onlinetime',
|
||||
|
@ -71,9 +75,12 @@ def main(configuration):
|
|||
# setup logging
|
||||
if configuration.getboolean('General', 'debug'):
|
||||
logger.setLevel(logging.DEBUG)
|
||||
if configuration.getboolean('General', 'debugstdout'):
|
||||
stream_handler.setLevel(logging.DEBUG)
|
||||
|
||||
# attach handlers
|
||||
logger.addHandler(file_handler)
|
||||
logger.addHandler(stream_handler)
|
||||
logger.addHandler(file_handler)
|
||||
|
||||
idmap = configuration.get('General', 'idmap')
|
||||
if idmap:
|
||||
|
|
|
@ -13,6 +13,7 @@ logger = logging.getLogger('tsstats')
|
|||
DEFAULT_CONFIG = {
|
||||
'General': {
|
||||
'debug': False,
|
||||
'debugstdout': False,
|
||||
'log': '',
|
||||
'output': 'tsstats.html',
|
||||
'idmap': '',
|
||||
|
|
Loading…
Reference in New Issue