aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2022-06-01 13:37:10 -0700
committerGravatar MarkKoz <[email protected]>2022-06-01 13:37:10 -0700
commit91d08e3248c3c10e33f8d9af7f0c9fcfeb31619d (patch)
tree2b8d8192a47aad9244804335f1b502f7c2d8ec78
parentFix WSGI app not being called (diff)
Ignore deprecation warning from Sentry's Falcon integration
-rw-r--r--snekbox/utils/logging.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/snekbox/utils/logging.py b/snekbox/utils/logging.py
index c15e3f1..a73db2d 100644
--- a/snekbox/utils/logging.py
+++ b/snekbox/utils/logging.py
@@ -1,6 +1,10 @@
import logging
import os
import sys
+import warnings
+
+from falcon.util.deprecation import DeprecatedWarning
+
__all__ = ("FORMAT", "init_logger", "init_sentry")
@@ -21,11 +25,14 @@ def init_logger(debug: bool) -> None:
def init_sentry(version: str) -> None:
"""Initialise the Sentry SDK if it's installed."""
- try:
- import sentry_sdk
- from sentry_sdk.integrations.falcon import FalconIntegration
- except ImportError:
- return
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", message=r".*\bapi_helpers\b", category=DeprecatedWarning)
+
+ try:
+ import sentry_sdk
+ from sentry_sdk.integrations.falcon import FalconIntegration
+ except ImportError:
+ return
sentry_sdk.init(
dsn=os.environ.get("SNEKBOX_SENTRY_DSN", ""),