Skip to content

adambyrtek/airbrake-flask

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

airbrake-flask

Airbrake client for Python Flask Microframework

Build Status Coverage Status Downloads Version

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)

About

Airbrake client for Python Flask Microframework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 95.2%
  • Makefile 4.8%