Skip to content

Commit

Permalink
chore(sentry): use logger instead of print
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Oct 11, 2023
1 parent 77f1366 commit f000807
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions eligibility_server/sentry.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import os
import subprocess

Expand All @@ -7,6 +8,8 @@

from eligibility_server.settings import Configuration

logger = logging.getLogger(__name__)


SENTRY_ENVIRONMENT = os.environ.get("SENTRY_ENVIRONMENT", "local")

Expand All @@ -30,7 +33,7 @@ def configure(config: Configuration):
SENTRY_DSN = config.sentry_dsn
if SENTRY_DSN:
release = get_release()
print(f"Enabling Sentry for environment '{SENTRY_ENVIRONMENT}', release '{release}'...")
logger.info(f"Enabling Sentry for environment '{SENTRY_ENVIRONMENT}', release '{release}'...")

sentry_sdk.init(
dsn=SENTRY_DSN,
Expand All @@ -47,4 +50,4 @@ def configure(config: Configuration):
event_scrubber=EventScrubber(denylist=get_denylist()),
)
else:
print("SENTRY_DSN not set, so won't send events")
logger.warning("SENTRY_DSN not set, so won't send events")

0 comments on commit f000807

Please sign in to comment.