Alternative to Python's module `cgitb` with template inspired by Nette and Django
Project description
Module for logging of detailed traceback as HTML page. Unexpected exceptions are catched and logged for further audit. Exceptions in diagnostic’s exception handler are properly handled and logged (but formatted only as standard Python traceback). Usage is simple as code below
from diagnostics import exception_hook
if __name__ == '__main__':
# you have to create "log/" directory next to file that is your main module
exception_hook.enable()
from diagnostics import exception_hook
from diagnostics.storages import FileStorage
if __name__ == '__main__':
# or simply set your own storage
directory_path = "/path/to/your/log/directory/with/html/tracebacks"
exception_hook.enable(storage=FileStorage(directory_path))
Installation
From PyPI
pip install diagnostics
or from git repo
pip install git+git@github.com:miso-belica/diagnostics.git
Tests
Run tests via
$ cd tests
$ python -tt -Wall -B -3 -m unittest discover
$ python3 -tt -Wall -B -m unittest discover
Copyright 2013 Michal Belica
Changelog for diagnostics module
0.1.0 (2013-02-13)
First public release.
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
diagnostics-0.1.0.zip
(19.8 kB
view hashes)