From 3782024b9de099df6650a776ba8dae6d9dc6379d Mon Sep 17 00:00:00 2001 From: Ben Bangert Date: Wed, 29 Jun 2016 20:51:50 -0700 Subject: [PATCH] fix: remove failing key check from sentry logging 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 --- autopush/logging.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autopush/logging.py b/autopush/logging.py index 8f2f15f1..e0f4ebcb 100644 --- a/autopush/logging.py +++ b/autopush/logging.py @@ -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 @@ -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()) @@ -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: