https://github.com/dermasmid/python-exterminator
Log the important data when a exception occurs.
https://github.com/dermasmid/python-exterminator
Last synced: 3 months ago
JSON representation
Log the important data when a exception occurs.
- Host: GitHub
- URL: https://github.com/dermasmid/python-exterminator
- Owner: dermasmid
- License: mit
- Created: 2020-11-10T16:20:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-19T21:42:48.000Z (over 4 years ago)
- Last Synced: 2024-02-14T17:03:37.448Z (over 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pest control
Bugs are bad, but it's even worse when it happens in production, this is why it is a good idea to document all data possible when a exception occurs.
## Installing
``` bash
pip3 install exterminator
```## Usage
You have three options.
### As a decorator
``` python
from exterminator import Exterminator@Exterminator()
def main_function():
# do stuff that might workmain_function()
```### As a context manager
``` python
from exterminator import Exterminatorwith Exterminator():
# do stuff, you know the thing
```### Globally
``` python
from exterminator import ExterminatorExterminator().globally()
# that's it! now every exception that is not handled will be logged
```## Important Note
If you are going to except all errors the context manager and globally solution wont work for you, the only option for you will be:
``` python
from exterminator import Exterminator@Exterminator()
def main_function():
# do stuff that work or nottry:
main_function()
except:
# do some stuff of your own...
```