From c42e959c3c0ad26013c723f6496cb5a13b693932 Mon Sep 17 00:00:00 2001 From: Matt Duncan Date: Fri, 1 May 2026 15:05:41 -0700 Subject: [PATCH] ref(issues): Use module logger in issue_occurrence Replace bare logging.exception() calls in IssueOccurrence.from_dict with a module-level logger. Logging via the root logger loses module-name context and is inconsistent with the rest of src/sentry/issues/. Co-Authored-By: Claude --- src/sentry/issues/issue_occurrence.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sentry/issues/issue_occurrence.py b/src/sentry/issues/issue_occurrence.py index 3fa9ecf5aa72..0ead5427cd79 100644 --- a/src/sentry/issues/issue_occurrence.py +++ b/src/sentry/issues/issue_occurrence.py @@ -14,6 +14,8 @@ from sentry.types.actor import Actor from sentry.utils.dates import parse_timestamp +logger = logging.getLogger(__name__) + DEFAULT_LEVEL = "info" @@ -147,10 +149,10 @@ def from_dict(cls, data: IssueOccurrenceData) -> IssueOccurrence: # that, so subsequent fetches won't cause IO. assignee = Actor.from_identifier(data.get("assignee")) except ValidationError: - logging.exception("Failed to parse assignee actor identifier") + logger.exception("Failed to parse assignee actor identifier") except Exception: # We never want this to cause parsing an occurrence to fail - logging.exception("Unexpected error parsing assignee") + logger.exception("Unexpected error parsing assignee") return cls( data["id"], data["project_id"],