diff options
author | rubenwardy <rw@rubenwardy.com> | 2020-04-14 14:45:06 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2020-04-14 14:45:06 +0100 |
commit | bbaa687aa7c3693cf0aeb32bfe7119f256e6e46a (patch) | |
tree | 671107420aa5f2dfafa3a05af567ce58149be749 | |
parent | dadfe72b480f05d6d31aaf575afaa34e53c450ab (diff) | |
download | cheatdb-bbaa687aa7c3693cf0aeb32bfe7119f256e6e46a.tar.xz |
Format exception emails better
-rw-r--r-- | app/maillogger.py | 4 |
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) |