Skip to content

Commit

Permalink
Add sentry cloud logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rhinodavid committed Mar 31, 2019
1 parent 03f0910 commit 0eaf034
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements_openpilot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ raven==5.23.0
recordclass==0.4.1
requests==2.10.0
scipy==0.19.1
sentry_sdk==0.7.6
service-identity==16.0.0
setproctitle==1.1.10
simplejson==3.8.2
Expand Down
5 changes: 5 additions & 0 deletions selfdrive/crash.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"""Install exception handler for process crash."""
import logging
import os
import sentry_sdk
import sys
import threading
from selfdrive.version import version, dirty

from selfdrive.swaglog import cloudlog

sentry_sdk.init("https://a540b8de0afc4b1cbac75da8f1b8fa6a@sentry.io/1415042")

if os.getenv("NOLOG") or os.getenv("NOCRASH"):
def capture_exception(*exc_info):
pass
Expand All @@ -24,6 +28,7 @@ def install():
def capture_exception(*args, **kwargs):
client.captureException(*args, **kwargs)
cloudlog.error("crash", exc_info=kwargs.get('exc_info', 1))
logging.error("crash", exc_info=kwargs.get('exc_info', 1))

def bind_user(**kwargs):
client.user_context(kwargs)
Expand Down

0 comments on commit 0eaf034

Please sign in to comment.