{ "info": { "author": "Michal Belica", "author_email": "miso.belica@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Bug Tracking", "Topic :: Utilities" ], "description": "===========\nDiagnostics\n===========\n.. image:: https://api.travis-ci.org/miso-belica/diagnostics.png?branch=master\n :target: https://travis-ci.org/miso-belica/diagnostics\n\nModule for logging of `detailed traceback\n`_ as HTML page.\nUnexpected exceptions are catched and logged for further audit. Exceptions\nin diagnostic's exception handler are properly handled and logged\n(but formatted only as standard Python traceback). Usage is simple as code below.\n\n.. code-block:: python\n\n from diagnostics import exception_hook\n\n if __name__ == '__main__':\n # you have to create \"log/\" directory next to file that is your main module\n exception_hook.enable()\n\n.. code-block:: python\n\n from diagnostics import exception_hook\n from diagnostics.storages import FileStorage\n\n if __name__ == '__main__':\n # or simply set your own storage\n directory_path = \"/path/to/your/log/directory/with/html/tracebacks\"\n exception_hook.enable(storage=FileStorage(directory_path))\n\n.. code-block:: python\n\n from diagnostics import exception_hook\n\n if __name__ == '__main__':\n with exception_hook:\n try_do_risky_job(...)\n\nThere is even support for logging in diagnostics. Class\n``diagnostics.logging.FileHandler`` creates files with detailed traceback\nand log messages are appended to the file *info.log* in directory with\nlogged tracebacks.\n\n.. code-block:: python\n\n import logging\n\n from diagnostics import exception_hook\n from diagnostics.logging import FileHandler\n\n if __name__ == '__main__':\n file_path = \"/path/to/log/directory/with/html/tracebacks/info.log\"\n log_handler = FileHandler(file_path)\n exception_hook.enable_for_logger(logging.getLogger(), handler=log_handler)\n\n try:\n try_do_risky_job(...)\n except:\n logging.exception(\"Risky job failed\")\n\n.. code-block:: python\n\n import logging\n\n from diagnostics import exception_hook\n from diagnostics.logging import FileHandler\n\n if __name__ == '__main__':\n file_path = \"/path/to/log/directory/with/html/tracebacks/info.log\"\n log_handler = FileHandler(file_path)\n exception_hook.enable_for_logger(\"example_logger\", handler=log_handler)\n\n try:\n try_do_risky_job(...)\n except:\n logger = logging.getLogger(\"example_logger\")\n logger.error(\"Error occured\", exc_info=True)\n\nInstallation\n------------\nFrom PyPI\n::\n\n pip install diagnostics\n\nor from git repo\n::\n\n pip install git+git://github.com/miso-belica/diagnostics.git\n\nTests\n-----\nRun tests via\n\n.. code-block:: bash\n\n $ nosetests-2.6 && nosetests-3.2 && nosetests-2.7 && nosetests-3.3\n\n\n.. :changelog:\n\nChangelog for diagnostics module\n================================\n0.2.4 (2014-04-14)\n------------------\n- *BUG FIX:* Correctly logged traceback if no exception occured.\n\n0.2.3 (2013-11-15)\n------------------\n- *BUG FIX:* Context code is rendered with correct line number even\n when exception is raised from with-statement block.\n- *BUG FIX:* Added time and logging level name into log messages.\n\n0.2.2 (2013-10-05)\n------------------\n- *BUG FIX:* Fixed usage in terminal.\n- *BUG FIX:* Fixed reading of JS/CSS file in Python 3. HTML traceback\n is properly rendered.\n\n0.2.1 (2013-10-04)\n------------------\n- *FEATURE:* Removed empty trailing lines from context code.\n- *BUG FIX:* Removed duplicated global variables from list of local variables.\n- *BUG FIX:* Don't show types/modules/functions in list of local variables.\n\n0.2.0 (2013-06-22)\n------------------\n- *BUG FIX:* Removed class types, modules and other crap from\n list of global variables.\n- *BUG FIX:* Function/method variables are ordered according\n to function/method signature.\n- *FEATURE:* The same exceptions are stored only once\n (according to their hash).\n- *BUG FIX:* Recover when converting object to unicode raises\n exception (e.g. BeautifulSoup).\n- *BUG FIX:* Format code context even if code is in binary form\n (e.g. lxml).\n- *BUG FIX:* Use `repr` function when instance can't be de/en-coded\n to the unicode/bytes.\n- *BUG FIX:* Tracebacks with the same type of exception and timestamp\n are stored to different files.\n- *FEATURE:* Added support for with statement.\n- *FEATURE:* Added logging support.\n\n0.1.0 (2013-02-13)\n------------------\n- First public release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/miso-belica/diagnostics", "keywords": "debug,cgitb,traceback", "license": "Copyright 2013 Michal Belica\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.", "maintainer": null, "maintainer_email": null, "name": "diagnostics", "package_url": "https://pypi.org/project/diagnostics/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/diagnostics/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/miso-belica/diagnostics" }, "release_url": "https://pypi.org/project/diagnostics/0.2.4/", "requires_dist": null, "requires_python": null, "summary": "Alternative to Python's module `cgitb` with template inspired by Nette and Django", "version": "0.2.4" }, "last_serial": 1059784, "releases": { "0.0.1": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "4eedb0630d7969e7c9e0a0e3edd0c14e", "sha256": "b187c17355d326e89458a47d156150fec451883054b305eeec8b79f9db0362a6" }, "downloads": -1, "filename": "diagnostics-0.1.0.zip", "has_sig": false, "md5_digest": "4eedb0630d7969e7c9e0a0e3edd0c14e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19789, "upload_time": "2013-02-13T15:02:38", "url": "https://files.pythonhosted.org/packages/74/1b/f2ffc028f64daf21c1c34ec2b7e96e57fc20a63889d4af0c612c9af9f618/diagnostics-0.1.0.zip" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "debfad45f48bceb753e508bc84da85a0", "sha256": "764d687eb54209e7c68b0d55801bb3878ac4e3b70e005594d19272abb9a7d442" }, "downloads": -1, "filename": "diagnostics-0.2.0.zip", "has_sig": false, "md5_digest": "debfad45f48bceb753e508bc84da85a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24565, "upload_time": "2013-06-22T22:01:36", "url": "https://files.pythonhosted.org/packages/4a/35/c1eab9dd4af1bb6b39b46ff24a5eac26125c6674d163f3f09621fc6ba956/diagnostics-0.2.0.zip" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "4ae2bc658c08f81755bd8b087e1334cf", "sha256": "b45f243bd3e91dcffbbc0458d4b0561218f1831604204c24db95df9573b2e7d7" }, "downloads": -1, "filename": "diagnostics-0.2.1.zip", "has_sig": false, "md5_digest": "4ae2bc658c08f81755bd8b087e1334cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28348, "upload_time": "2013-10-04T12:35:22", "url": "https://files.pythonhosted.org/packages/b6/24/85050e811706fbb3372cfdf438f88e18f1595fcb660b08769c9c178f9d35/diagnostics-0.2.1.zip" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "62d1febc4b0f7ca05f553ad876c110fb", "sha256": "9bb38a62d8bd10fcbf70bd48f4f9b0be492185842de8c7fac494d4ddb72d7da5" }, "downloads": -1, "filename": "diagnostics-0.2.2.zip", "has_sig": false, "md5_digest": "62d1febc4b0f7ca05f553ad876c110fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28392, "upload_time": "2013-10-05T17:31:14", "url": "https://files.pythonhosted.org/packages/47/8d/755f419bb539a2178d1c4946182831de3e38da4e19ef4591147571b7db15/diagnostics-0.2.2.zip" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "77fa028c122d47991aefd6face18e4ff", "sha256": "412089182988c6c69dc5b6cbba20aa96ad4daff0d10e7933f76d2dd6f858bc12" }, "downloads": -1, "filename": "diagnostics-0.2.3.zip", "has_sig": false, "md5_digest": "77fa028c122d47991aefd6face18e4ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28974, "upload_time": "2013-11-15T20:50:38", "url": "https://files.pythonhosted.org/packages/d4/19/b024147bd663ffb35c648ec408d68fcf8b894ed442e7b88a029bff57415e/diagnostics-0.2.3.zip" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "788dcbdf8b18e52d5b3e1196cfe2ffb3", "sha256": "9034490062c307b2bf85ca871fc7fe7b5e47883a43945491ff3712abd64ece98" }, "downloads": -1, "filename": "diagnostics-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "788dcbdf8b18e52d5b3e1196cfe2ffb3", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 25938, "upload_time": "2014-04-14T07:26:14", "url": "https://files.pythonhosted.org/packages/9a/be/ab13f03cfae2c37620c14fe7d100527b369e2e4559e730d88233eeefb03c/diagnostics-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b978a46b56c84f96c92fc2dfa79c8c8", "sha256": "40e635fcce55175e7bcaa9b48f127d5fb37f1b8d16110503731605c568af8c45" }, "downloads": -1, "filename": "diagnostics-0.2.4.win32.exe", "has_sig": false, "md5_digest": "5b978a46b56c84f96c92fc2dfa79c8c8", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 223942, "upload_time": "2014-04-14T07:26:11", "url": "https://files.pythonhosted.org/packages/b9/de/995c1a1fbb82400768e6c1bfa97308ea6d74bc9cad60edff0b3d6168df27/diagnostics-0.2.4.win32.exe" }, { "comment_text": "", "digests": { "md5": "328ebcb606868877883d4d01194b9ce9", "sha256": "11fc6f9b9c9a30f926d19b8d57cf62aca750323097eda85c3d2a3da880d3f65e" }, "downloads": -1, "filename": "diagnostics-0.2.4.zip", "has_sig": false, "md5_digest": "328ebcb606868877883d4d01194b9ce9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29101, "upload_time": "2014-04-14T07:26:08", "url": "https://files.pythonhosted.org/packages/32/4c/fe783877a8d754c1485ba0b0a7d25d0434efd59f57d0dd64be8239f4f07d/diagnostics-0.2.4.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "788dcbdf8b18e52d5b3e1196cfe2ffb3", "sha256": "9034490062c307b2bf85ca871fc7fe7b5e47883a43945491ff3712abd64ece98" }, "downloads": -1, "filename": "diagnostics-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "788dcbdf8b18e52d5b3e1196cfe2ffb3", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 25938, "upload_time": "2014-04-14T07:26:14", "url": "https://files.pythonhosted.org/packages/9a/be/ab13f03cfae2c37620c14fe7d100527b369e2e4559e730d88233eeefb03c/diagnostics-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b978a46b56c84f96c92fc2dfa79c8c8", "sha256": "40e635fcce55175e7bcaa9b48f127d5fb37f1b8d16110503731605c568af8c45" }, "downloads": -1, "filename": "diagnostics-0.2.4.win32.exe", "has_sig": false, "md5_digest": "5b978a46b56c84f96c92fc2dfa79c8c8", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 223942, "upload_time": "2014-04-14T07:26:11", "url": "https://files.pythonhosted.org/packages/b9/de/995c1a1fbb82400768e6c1bfa97308ea6d74bc9cad60edff0b3d6168df27/diagnostics-0.2.4.win32.exe" }, { "comment_text": "", "digests": { "md5": "328ebcb606868877883d4d01194b9ce9", "sha256": "11fc6f9b9c9a30f926d19b8d57cf62aca750323097eda85c3d2a3da880d3f65e" }, "downloads": -1, "filename": "diagnostics-0.2.4.zip", "has_sig": false, "md5_digest": "328ebcb606868877883d4d01194b9ce9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29101, "upload_time": "2014-04-14T07:26:08", "url": "https://files.pythonhosted.org/packages/32/4c/fe783877a8d754c1485ba0b0a7d25d0434efd59f57d0dd64be8239f4f07d/diagnostics-0.2.4.zip" } ] }