Skip to content
Snippets Groups Projects
Commit 2d1cd6af authored by vlorentz's avatar vlorentz
Browse files

Use logger instance instead of logging module directly

parent e8253c54
No related branches found
No related tags found
No related merge requests found
......@@ -431,7 +431,7 @@ def error_handler(exception, encoder, status_code=500):
"""
status_class = status_code // 100
if status_class == 5:
logging.exception(exception)
logger.exception(exception)
sentry_sdk.capture_exception(exception)
response = encoder(exception_to_dict(exception))
......
......@@ -21,6 +21,8 @@ from .serializers import (
msgpack_loads,
)
logger = logging.getLogger(__name__)
def encode_msgpack(data, **kwargs):
return aiohttp.web.Response(
......@@ -68,7 +70,7 @@ async def error_middleware(app, handler):
except Exception as e:
if isinstance(e, aiohttp.web.HTTPException):
raise
logging.exception(e)
logger.exception(e)
res = exception_to_dict(e)
if isinstance(e, app.client_exception_classes):
status = 400
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment