Skip to main content

A logging framework handler that tracks when messages above a certain level have been logged.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

errorhandler-1.1.0.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file errorhandler-1.1.0.tar.gz.

File metadata

  • Download URL: errorhandler-1.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for errorhandler-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4a53a9629e2ebb6b6c880f7146c3dfbe0e5310483936a9c8b311f84564711f37
MD5 96db35e03366231ee478bf804e9c5e1e
BLAKE2b-256 d51ea4e48cb202bf89ed60e8817c54bb620987fd84be7c7f58d2cd199fadc100

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page