This repo contains the source code for bugsplat-py, a BugSplat integration for reporting Unhandled Exceptions in Python.
Install the bugsplat package using pip
pip install bugsplat
- Import the BugSplat class
from bugsplat import BugSplat
- Create a new BugSplat instance passing it the name of your BugSplat database, application and version
bugsplat = BugSplat(database, application, version)
- Optionally, you set default values for appKey, description, email, user and additionaFilePaths
bugsplat.setDefaultAppKey('key!')
bugsplat.setDefaultDescription('description!')
bugsplat.setDefaultEmail('fred@bugsplat.com')
bugsplat.setDefaultUser('Fred')
bugsplat.setDefaultAdditionalFilePaths([
'./path/to/additional-file.txt',
'./path/to/additional-file-2.txt'
])
- Wrap your application code in a try except block. In the except block call post. You can override any of the default properties that were set in step 3
try:
crash()
except Exception as e:
bugsplat.post(
e,
additionalFilePaths=[],
appKey='other key!',
description='other description!',
email='barney@bugsplat.com',
user='Barney'
)
- Once you've posted a crash, navigate to the Crashes page and click the link in the ID column to be see the crash's details
To get a development environment started:
- Clone the repository
git clone https://github.com/BugSplat-Git/bugsplat-py.git
- Create a virtual environment
pyhon -m venv venv
- Activate virtual environment
# unix/macos
source venv/bin/activate
# windows
.\env\Scripts\activate
- Install dependencies
pip install .
Thanks for using BugSplat β€οΈ