From e2b234d9ed99ba90835d0a4c59ea22dde1262352 Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Tue, 6 Dec 2022 11:50:42 -0500 Subject: Setting to enable Sentry capture_messages (#128) --- core/exceptions.py | 2 +- takahe/settings.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/exceptions.py b/core/exceptions.py index 335b7d6..d41bb82 100644 --- a/core/exceptions.py +++ b/core/exceptions.py @@ -20,7 +20,7 @@ def capture_message(message: str): """ Sends the informational message to Sentry if it's configured """ - if settings.SETUP.SENTRY_DSN: + if settings.SETUP.SENTRY_DSN and settings.SENTRY_CAPTURE_MESSAGES: from sentry_sdk import capture_message capture_message(message) diff --git a/takahe/settings.py b/takahe/settings.py index f263153..981bb96 100644 --- a/takahe/settings.py +++ b/takahe/settings.py @@ -87,6 +87,7 @@ class Settings(BaseSettings): SENTRY_DSN: str | None = None SENTRY_SAMPLE_RATE: float = 1.0 SENTRY_TRACES_SAMPLE_RATE: float = 1.0 + SENTRY_CAPTURE_MESSAGES: bool = False #: Fallback domain for links. MAIN_DOMAIN: str = "example.com" -- cgit v1.2.3