Count how many time errors occur
Project description
Compteur
I use Python scripts in crontab. Sometimes, a script crashes, and I receive an email with the error.
But it can be a random crash and I do not need to know it, as it will not crash next time the script is launched.
Goal of this package is to track how many times an error occurs. I can define a limit of # errors before warning me.
Exemple
#!/usr/bin/env python3
from compteur import Compteur
cpt = Compteur('smartname')
try:
# My wonderful script
except:
cpt.inc()
if cpt.isLimit():
raise
else:
cpt.reset()
finally:
# do something
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file compteur-1.1.tar.gz.
File metadata
- Download URL: compteur-1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14ff0df3461b70815e9c2eee64658814b4524ca135b5a4088f78cae62a18527e
|
|
| MD5 |
6f05b15cd51167a2b92ad06148661248
|
|
| BLAKE2b-256 |
b036302ce7c4debdd5715e6922d4d9834e5f23040801046c374a3918ffbb5094
|
File details
Details for the file compteur-1.1-py3-none-any.whl.
File metadata
- Download URL: compteur-1.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
332eaead21f21daa9dc3050dd310f3c3dadb6f9f3eda650452e554d111918e41
|
|
| MD5 |
d50a2953f9529ef27a643a8740211ff5
|
|
| BLAKE2b-256 |
847c53d6c019ecdc177927e0b7d9988d1b419a38b26408441aed255bf51729eb
|