aboutsummaryrefslogtreecommitdiff
path: root/qc_app/errors.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-04-10 07:49:51 +0300
committerFrederick Muriuki Muriithi2024-04-10 07:49:51 +0300
commit30e905782b58f4e166c4a166102ea0f7c927dcef (patch)
tree8d78eabacb6b874f67d44189a9e6878abfd43e74 /qc_app/errors.py
parent52eb1ba2305da59b1760ff8d805367ba162ba2e7 (diff)
downloadgn-uploader-30e905782b58f4e166c4a166102ea0f7c927dcef.tar.gz
Use application logger, not root logger.
Diffstat (limited to 'qc_app/errors.py')
-rw-r--r--qc_app/errors.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/qc_app/errors.py b/qc_app/errors.py
index 7af7696..d7d3858 100644
--- a/qc_app/errors.py
+++ b/qc_app/errors.py
@@ -3,12 +3,12 @@ import logging
import traceback
import MySQLdb as mdb
-from flask import Flask, request, render_template
+from flask import Flask, request, render_template, current_app as app
def handle_general_exception(exc: Exception):
"""Handle generic exceptions."""
trace = traceback.format_exc()
- logging.error(
+ app.logger.error(
"Error (%s.%s): Generic unhandled exception!! (URI: %s)\n%s",
exc.__class__.__module__, exc.__class__.__name__, request.url, trace)
return render_template("unhandled_exception.html", trace=trace)