Skip to content

Commit

Permalink
Add logging report
Browse files Browse the repository at this point in the history
Required to implement MeerkatLabs/autology#62
  • Loading branch information
rerobins committed May 15, 2018
1 parent 85e37f9 commit 93c1ab3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
31 changes: 31 additions & 0 deletions autology_templates/logging/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends "base.html" %}
{% block subtitle %}Log Reporting{% endblock %}

{% block body %}

<div class="container">
<h1>Logs</h1>

{% for log_record in log_records %}

{% if log_record.levelno >= 40 %}
<div class="alert alert-danger">
{% elif log_record.levelno >= 30 %}
<div class="alert alert-warning">
{% elif log_record.levelno >= 20 %}
<div class="alert alert-info">
{% else %}
<div class="alert alert-light">
{% endif %}

<p>{{log_record.levelname}} - {{ log_record.getMessage() }}</p>

<hr>

<p>{{ log_record.pathname }} - {{ log_record.lineno }}</p>
</div>

{% endfor %}

</div>
{% endblock %}
4 changes: 4 additions & 0 deletions autology_templates/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ templates:
destination: 'exercise/{report.date.year:04d}/{report.date.month:02d}/{report.date.day:02d}.html'
data_file:
destination: 'exercise/{date.year:04d}/{date.month:02d}/{date.day:02d}/{file_name}'
logging:
index:
template: logging/index.html
destination: logging/index.html
index:
index:
template: index/index.html
Expand Down

0 comments on commit 93c1ab3

Please sign in to comment.