rodneyosodo / computer-vision-ai-saturdays

This repository contains classwork and homework for JKUAT SES Project under computer vision. Good luck in finding new bugs 😀.
MIT License
11 stars 17 forks source link

Setup Airbrake for your Python application #14

Closed rodneyosodo closed 4 years ago

rodneyosodo commented 5 years ago

Installation

Using pip

pip install -U airbrake

Setup

The easiest way to get set up is with a few environment variables:

(You can find your project ID and API KEY with your project's settings):

export AIRBRAKE_API_KEY=<Your project API KEY>
export AIRBRAKE_PROJECT_ID=<Your project ID>
export AIRBRAKE_ENVIRONMENT=production

and you're done!

Otherwise, you can instantiate your AirbrakeHandler by passing these values as arguments to the getLogger() helper:

import airbrake

logger = airbrake.getLogger(api_key="<Your project API KEY>", project_id=<Your project ID>)

try:
    1/0
except Exception:
    logger.exception("Bad math.")

For more information please visit our official GitHub repo.

github-actions[bot] commented 4 years ago

Stale issue message