Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
fix: remove failing key check from sentry logging
Browse files Browse the repository at this point in the history
Twisteds new logging does not use the 'failure' key at all, the
prior assumptions it would exist caused key exceptions instead
of reporting errors. This fix changes to only the new style of
failure checking.

Issue #493
  • Loading branch information
bbangert committed Jul 13, 2016
1 parent e45b82d commit 6c90f8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autopush/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def __init__(self, logger_name, log_level="debug", log_format="json",
self.raven_client = raven.Client(
release=raven.fetch_package_version("autopush"),
transport=TwistedHTTPTransport,
enable_breadcrumbs=False,
)
else:
self.raven_client = None
Expand All @@ -88,9 +89,8 @@ def __init__(self, logger_name, log_level="debug", log_format="json",
self.firehose = None

def __call__(self, event):
if self.raven_client and ('failure' in event or
'log_failure' in event):
f = event.get("log_failure", event["failure"])
if self.raven_client and 'log_failure' in event:
f = event["log_failure"]
reactor.callFromThread(
self.raven_client.captureException,
exc_info=(f.type, f.value, f.getTracebackObject())
Expand All @@ -109,7 +109,7 @@ def __call__(self, event):
self._output.flush()

def json_format(self, event):
error = bool(event.get("isError")) or "failure" in event
error = bool(event.get("isError")) or "log_failure" in event
ts = event["log_time"]

if error:
Expand Down

0 comments on commit 6c90f8d

Please sign in to comment.