ErrorHandler
This is a handler for the python standard logging framework that can be used to tell whether messages have been logged at or above a certain level.
This can be useful when wanting to ensure that no errors have been logged before committing data back to a database.
As an example, first, you set up the error handler:
>>> from errorhandler import ErrorHandler >>> e = ErrorHandler()
Then you can log and check the handler at any point to see if it has been triggered:
>>> e.fired
False
>>> from logging import getLogger
>>> logger = getLogger()
>>> logger.error('an error')
>>> e.fired
True
You can use the fired attribute to only perform actions when no errors have been logged:
>>> if e.fired: ... print "Not updating files as errors have occurred" Not updating files as errors have occurred
Installation
Do the following in your virtualenv:
pip install errorhandler
Documentation
The latest documentation can also be found at: http://errorhandler.readthedocs.org/en/latest/
Licensing
Copyright (c) 2008-2015 Simplistix Ltd, 2016 Chris Withers. See docs/license.txt for details.
Release files for errorhandler 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| errorhandler-2.0.1.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| errorhandler-2.0.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 14.1 kB
Release files / errorhandler-2.0.1.tar.gz
| Download URL | errorhandler-2.0.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e578ad67af40845bfd044f71627a29f1fc436d53ccb058bbf1792ef31ab6163
|
|
BLAKE2b-256 checksum How to use checksums |
eef46efa866dfb5b72d468666eb69adc19142e3956af8e6a95f3109d29685038
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / errorhandler-2.0.1-py2.py3-none-any.whl
| Download URL | errorhandler-2.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
dc6c54f5d9a4599e744b57aac2f925cce873188e9b02cae7c0eb120ee08a893f
|
|
BLAKE2b-256 checksum How to use checksums |
c80471d196b9ed5a561e10150c32892eaac9a85dfffdd09c5f850ea7e4e3344f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |