Add debug-logging-output to tsstats.template.render_template
* bump version to 0.11.1
This commit is contained in:
parent
959423be81
commit
d1627d369f
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@ from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='tsstats',
|
name='tsstats',
|
||||||
version='0.11.0',
|
version='0.11.1',
|
||||||
author='Thor77',
|
author='Thor77',
|
||||||
author_email='thor77@thor77.org',
|
author_email='thor77@thor77.org',
|
||||||
description='A simple Teamspeak stats-generator',
|
description='A simple Teamspeak stats-generator',
|
||||||
|
|
|
@ -57,10 +57,14 @@ def render_template(clients, output, title='TeamspeakStats',
|
||||||
def frmttime(timestamp):
|
def frmttime(timestamp):
|
||||||
if not timestamp:
|
if not timestamp:
|
||||||
return ''
|
return ''
|
||||||
return timestamp.strftime(datetime_fmt)
|
formatted = timestamp.strftime(datetime_fmt)
|
||||||
|
logger.debug('Formatting timestamp %s -> %s', timestamp, formatted)
|
||||||
|
return formatted
|
||||||
template_env.filters['frmttime'] = frmttime
|
template_env.filters['frmttime'] = frmttime
|
||||||
template = template_env.get_template(template_path)
|
template = template_env.get_template(template_path)
|
||||||
|
logger.debug('Rendering template %s', template)
|
||||||
with open(output, 'w') as f:
|
with open(output, 'w') as f:
|
||||||
f.write(template.render(title=title, objs=objs,
|
f.write(template.render(title=title, objs=objs,
|
||||||
debug=logger.level <= logging.DEBUG,
|
debug=logger.level <= logging.DEBUG,
|
||||||
creation_time=datetime.now()))
|
creation_time=datetime.now()))
|
||||||
|
logger.debug('Wrote rendered template to %s', output)
|
||||||
|
|
Loading…
Reference in New Issue