aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-04-14 14:45:06 +0100
committerrubenwardy <rw@rubenwardy.com>2020-04-14 14:45:06 +0100
commitbbaa687aa7c3693cf0aeb32bfe7119f256e6e46a (patch)
tree671107420aa5f2dfafa3a05af567ce58149be749
parentdadfe72b480f05d6d31aaf575afaa34e53c450ab (diff)
downloadcheatdb-bbaa687aa7c3693cf0aeb32bfe7119f256e6e46a.tar.xz
Format exception emails better
-rw-r--r--app/maillogger.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/maillogger.py b/app/maillogger.py
index 585cb29..10a046a 100644
--- a/app/maillogger.py
+++ b/app/maillogger.py
@@ -41,7 +41,7 @@ class FlaskMailHTMLFormatter(logging.Formatter):
formatted_exception = logging.Handler.formatException(self, exc_info)
return FlaskMailHTMLFormatter.pre_template % ("Exception information", formatted_exception)
def formatStack(self, stack_info):
- return FlaskMailHTMLFormatter.pre_template % ("<h1>Stack information</h1><pre>%s</pre>", stack_info)
+ return FlaskMailHTMLFormatter.pre_template % ("<h1>Stack information</h1><pre><code>%s</code></pre>", stack_info)
# see: https://github.com/python/cpython/blob/3.6/Lib/logging/__init__.py (class Handler)
@@ -100,7 +100,7 @@ Message:
<tr> <th>Time:</th><td>%(asctime)s</td></tr>
</table>
<h2>Message</h2>
-<pre>%(message)s</pre>"""
+<pre><code>%(message)s</code></pre>"""
import logging
mail_handler = FlaskMailHandler(mailer, subject_template)