Skip to main content

Make logging and reporting of errors easier, more informative, and more "standard."

Project description

app_error.py
============

The purpose of this module is to make logging and reporting of errors easier, more informative, and more
"standard."

Please see demo.py in this distribution for usage.

===

CHANGELOG:

1.1.0: Initial version.


These are libraries that help implement the principles of effective logging.

from apperror import AppLogger, AppStatus, AppError

l = AppLogger('demo')
l.error("I owe: $", 300, " dollars to my ex")
'demo: ERROR: demo.py:38: I owe: $400 dollars to my ex'

s = AppStatus()
if s.ok: print("ok!")
'ok'

s.addError("I owe money")
if s.ok: print("ok!")
if s.hasErrors(): l.warn('We have problems: ', str(s))
demo: WARN: demo 50: We have problems: I owe money

try:
raise AppError("We have lots of problems!")
except AppError as e:
l.info(e)
'demo: INFO: demo 57: we have lots of problems!'


See demo.py for full capabilities and usage examples

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

apperror-1.1.0.tar.gz (9.0 kB view hashes)

Uploaded Source

Supported by

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