Skip to content

Commit 24e5359

Browse files
authored
feat(spotlight): Add info logs when Sentry is enabled (#3735)
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.
1 parent e28dcf6 commit 24e5359

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

sentry_sdk/spotlight.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import io
2+
import logging
23
import os
34
import urllib.parse
45
import urllib.request
@@ -108,11 +109,10 @@ def setup_spotlight(options):
108109

109110
url = options.get("spotlight")
110111

111-
if isinstance(url, str):
112-
pass
113-
elif url is True:
112+
if url is True:
114113
url = DEFAULT_SPOTLIGHT_URL
115-
else:
114+
115+
if not isinstance(url, str):
116116
return None
117117

118118
if (
@@ -126,5 +126,9 @@ def setup_spotlight(options):
126126
settings.MIDDLEWARE = type(middleware)(
127127
chain(middleware, (DJANGO_SPOTLIGHT_MIDDLEWARE_PATH,))
128128
)
129+
logging.info("Enabled Spotlight integration for Django")
130+
131+
client = SpotlightClient(url)
132+
logging.info("Enabled Spotlight at %s", url)
129133

130-
return SpotlightClient(url)
134+
return client

0 commit comments

Comments
 (0)