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(
|
||||
name='tsstats',
|
||||
version='0.11.0',
|
||||
version='0.11.1',
|
||||
author='Thor77',
|
||||
author_email='thor77@thor77.org',
|
||||
description='A simple Teamspeak stats-generator',
|
||||
|
|
|
@ -57,10 +57,14 @@ def render_template(clients, output, title='TeamspeakStats',
|
|||
def frmttime(timestamp):
|
||||
if not timestamp:
|
||||
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 = template_env.get_template(template_path)
|
||||
logger.debug('Rendering template %s', template)
|
||||
with open(output, 'w') as f:
|
||||
f.write(template.render(title=title, objs=objs,
|
||||
debug=logger.level <= logging.DEBUG,
|
||||
creation_time=datetime.now()))
|
||||
logger.debug('Wrote rendered template to %s', output)
|
||||
|
|
Loading…
Reference in New Issue