Skip to content

Commit

Permalink
feat(spotlight): Add info logs when Sentry is enabled
Browse files Browse the repository at this point in the history
This came as user feedback (getsentry/spotlight#543). Intentionally not making this part of Sentry logging as I think if one is enabling Spotlight, they should be seeing this in their logs, regardless of their SENTRY_DEBUG setting, which tends to be noisy.
  • Loading branch information
BYK committed Nov 5, 2024
1 parent e28dcf6 commit cbdc15f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions sentry_sdk/spotlight.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import io
import logging
import os
import urllib.parse
import urllib.request
Expand Down Expand Up @@ -108,11 +109,10 @@ def setup_spotlight(options):

url = options.get("spotlight")

if isinstance(url, str):
pass
elif url is True:
if url is True:
url = DEFAULT_SPOTLIGHT_URL
else:

if not isinstance(url, str):
return None

if (
Expand All @@ -126,5 +126,9 @@ def setup_spotlight(options):
settings.MIDDLEWARE = type(middleware)(
chain(middleware, (DJANGO_SPOTLIGHT_MIDDLEWARE_PATH,))
)
logging.info("Enabled Spotlight integration for Django")

client = SpotlightClient(url)
logging.info("Enabled Spotlight at %s", url)

return SpotlightClient(url)
return client

0 comments on commit cbdc15f

Please sign in to comment.