Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F11012665
D8204.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D8204.diff
View Options
diff --git a/swh/core/api/__init__.py b/swh/core/api/__init__.py
--- a/swh/core/api/__init__.py
+++ b/swh/core/api/__init__.py
@@ -431,7 +431,7 @@
"""
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))
diff --git a/swh/core/api/asynchronous.py b/swh/core/api/asynchronous.py
--- a/swh/core/api/asynchronous.py
+++ b/swh/core/api/asynchronous.py
@@ -21,6 +21,8 @@
msgpack_loads,
)
+logger = logging.getLogger(__name__)
+
def encode_msgpack(data, **kwargs):
return aiohttp.web.Response(
@@ -68,7 +70,7 @@
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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 17, 4:27 AM (4 h, 20 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3223536
Attached To
D8204: Use logger instance instead of logging module directly
Event Timeline
Log In to Comment