[DEPRECATED] - Please use the official version ==>
Python Makefile
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
airbrake
bin
tests
.coveragerc
.gitignore
.travis.yml
LICENSE.txt
Makefile
README.md
setup.py

README.md

airbrake-flask

Airbrake client for Python Flask Microframework

Build Status Coverage Status Code Health Code Climate

License

Licensed under the MIT License.

Testing / Coverage

To run tests, you need to install some required packages. Remember to activate your virtualenv first.

# install required packages for test
$ pip install -e .[test]

# run test
$ make test

# generate coverage report
$ make cover

Example Usage with gevent

from flask import Flask, request, got_request_exception
from airbrake.airbrake import AirbrakeErrorHandler
import gevent
import sys
	
app = Flask(__name__)
ENV = ('ENV' in os.environ and os.environ['ENV']) or 'prod'

def log_exception(error):
	handler = AirbrakeErrorHandler(api_key="PUT_YOUR_AIRBRAKE_KEY_HERE",
									env_name=ENV,
									request=request)
	gevent.spawn(handler.emit, error, sys.exc_info())

got_request_exception.connect(log_exception, app)