askrobots / foxray Public

Foxray: a light error tracker for the Sentry SDKs. Runs inside Django (the admin is the UI) or on its own; SQLite or Postgres, nothing else. Not affiliated with Sentry.

0 downloads

foxray/tests/sdk_compat.py
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/foxray.git
HTTPS
https://gitstable.com/git/askrobots/foxray.git
SSH
ssh://git@gitstable.com:2222/askrobots/foxray.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 0.1.2: the first PyPI release (v0.1.1 is already tagged at 05cc354, before the PyPI metadata) 58507e3 4 weeks ago History
sdk_compat.py · 394 bytes · 15 lines
1"""The same checks on sentry-sdk 1.x (askrobots.com pins 1.9.10) and 2.x."""
2
3import sentry_sdk
4
5
6def sdk_client():
7 get = getattr(sentry_sdk, "get_client", None)
8 return get() if get else sentry_sdk.Hub.current.client
9
10
11def sdk_active() -> bool:
12 c = sdk_client()
13 if c is None:
14 return False
15 return c.is_active() if hasattr(c, "is_active") else c.transport is not None