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.
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 | |
| 3 | import sentry_sdk |
| 4 | |
| 5 | |
| 6 | def sdk_client(): |
| 7 | get = getattr(sentry_sdk, "get_client", None) |
| 8 | return get() if get else sentry_sdk.Hub.current.client |
| 9 | |
| 10 | |
| 11 | def 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 |