mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-24 06:51:29 +01:00
Format exception emails better
This commit is contained in:
parent
dadfe72b48
commit
bbaa687aa7
@ -41,7 +41,7 @@ class FlaskMailHTMLFormatter(logging.Formatter):
|
|||||||
formatted_exception = logging.Handler.formatException(self, exc_info)
|
formatted_exception = logging.Handler.formatException(self, exc_info)
|
||||||
return FlaskMailHTMLFormatter.pre_template % ("Exception information", formatted_exception)
|
return FlaskMailHTMLFormatter.pre_template % ("Exception information", formatted_exception)
|
||||||
def formatStack(self, stack_info):
|
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)
|
# 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>
|
<tr> <th>Time:</th><td>%(asctime)s</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<h2>Message</h2>
|
<h2>Message</h2>
|
||||||
<pre>%(message)s</pre>"""
|
<pre><code>%(message)s</code></pre>"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
mail_handler = FlaskMailHandler(mailer, subject_template)
|
mail_handler = FlaskMailHandler(mailer, subject_template)
|
||||||
|
Loading…
Reference in New Issue
Block a user