{ "info": { "author": "Laurentiu Badea", "author_email": "laurb9+rich-traceback@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: No Input/Output (Daemon)", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2" ], "description": "Informative Traceback Logging for Python\r\n\r\nInformative stack traces showing method parameters.\r\nSimple standalone logger with console syslog support.\r\n\r\nUsage:\r\n\r\n- If you're already using the logging module, import rich_traceback.enable in your module. Then logger.exception() will report nicely formatted exceptions.\r\n\r\nimport rich_traceback.enable\r\n\r\n- Otherwise, create a new logger using the RichTracebackFormatter class, or see rich_traceback.log as an example:\r\n\r\n(save as test.py)\r\n\r\n::\r\n\r\n from rich_traceback.formatter import RichTracebackFormatter\r\n import logging\r\n logger = logging.getLogger('root')\r\n console_log = logging.StreamHandler()\r\n console_log.setFormatter(RichTracebackFormatter())\r\n logger.addHandler(console_log)\r\n\r\n def foo(x=3):\r\n if 1.0/x:\r\n foo(x-1)\r\n\r\n try:\r\n foo()\r\n except:\r\n logger.exception(\"error running foo\")\r\n\r\n print \"compare with standard Python traceback\"\r\n foo() # for standard traceback\r\n\r\n::\r\n\r\n $ python test.py\r\n\r\n ERROR root test.:15 error running foo\r\n : ZeroDivisionError('float division by zero',) ([5] frames following)\r\n [4] test.py, foo(x=0) at line 9: if 1.0/x:\r\n [3] test.py, foo(x=1) at line 10: foo(x-1)\r\n [2] test.py, foo(x=2) at line 10: foo(x-1)\r\n [1] test.py, foo(x=3) at line 10: foo(x-1)\r\n [0] test.py, () at line 13: foo()\r\n\r\n compare with standard Python traceback\r\n Traceback (most recent call last):\r\n File \"test.py\", line 18, in \r\n foo()\r\n File \"test.py\", line 10, in foo\r\n foo(x-1)\r\n File \"test.py\", line 10, in foo\r\n foo(x-1)\r\n File \"test.py\", line 10, in foo\r\n foo(x-1)\r\n File \"test.py\", line 9, in foo\r\n if 1.0/x:\r\n ZeroDivisionError: float division by zero\r\n\r\n\r\nFor a global exception trap, see enable.py", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/laurb9/rich-traceback", "keywords": "traceback log syslog informative stack traces", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "rich-traceback", "package_url": "https://pypi.org/project/rich-traceback/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rich-traceback/", "project_urls": { "Homepage": "https://github.com/laurb9/rich-traceback" }, "release_url": "https://pypi.org/project/rich-traceback/1.0.2/", "requires_dist": [ "coverage; extra == 'test'", "check-manifest; extra == 'dev'" ], "requires_python": null, "summary": "Rich Traceback Logger", "version": "1.0.2" }, "last_serial": 1594724, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "d963669ae479f98db19fbc66d3c5a265", "sha256": "c94eaeeb6493333f678bfe2a56a33e0fc39ce920f401d3e900e330c253850d55" }, "downloads": -1, "filename": "rich_traceback-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "d963669ae479f98db19fbc66d3c5a265", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6556, "upload_time": "2015-06-10T15:27:16", "url": "https://files.pythonhosted.org/packages/ce/9b/26120a247a67456207feda4c6490de21d5606391dd12eb2aec729a72e201/rich_traceback-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b311dcf8588a178befac7538de0f7061", "sha256": "f818bdc398df904ddda56d0bfc3aac1ce8dfa68382b1f5c571e2408f24265b43" }, "downloads": -1, "filename": "rich-traceback-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b311dcf8588a178befac7538de0f7061", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8544, "upload_time": "2015-06-10T15:27:19", "url": "https://files.pythonhosted.org/packages/96/0e/76c0dab536f8139d3ec8b568eb876f64fe02c115d8e6ea65467d6cb6b7cb/rich-traceback-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "4d06542233621fcf2ec0583d398ef12f", "sha256": "a570b90e274f992877c10789852f97b7dfb6499a77140f331f0baa3e519d6b21" }, "downloads": -1, "filename": "rich_traceback-1.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "4d06542233621fcf2ec0583d398ef12f", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6625, "upload_time": "2015-06-11T06:56:22", "url": "https://files.pythonhosted.org/packages/a8/de/894c68e949ca116cc42d3af29ec8c58a065d01b62eea9e117db71118cff1/rich_traceback-1.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "766f2b734d655424646f4f6e5e5ff9c2", "sha256": "2d6c33006ffb8205d2d04a884f5c8bb35b16ebf51b4fc2bccce59dd651bde1bb" }, "downloads": -1, "filename": "rich-traceback-1.0.2.tar.gz", "has_sig": false, "md5_digest": "766f2b734d655424646f4f6e5e5ff9c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8590, "upload_time": "2015-06-11T06:56:25", "url": "https://files.pythonhosted.org/packages/2b/3d/3ebbb7c46f071493724580255bab494ee3402d6c50c9f5d701cb0648c51e/rich-traceback-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4d06542233621fcf2ec0583d398ef12f", "sha256": "a570b90e274f992877c10789852f97b7dfb6499a77140f331f0baa3e519d6b21" }, "downloads": -1, "filename": "rich_traceback-1.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "4d06542233621fcf2ec0583d398ef12f", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6625, "upload_time": "2015-06-11T06:56:22", "url": "https://files.pythonhosted.org/packages/a8/de/894c68e949ca116cc42d3af29ec8c58a065d01b62eea9e117db71118cff1/rich_traceback-1.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "766f2b734d655424646f4f6e5e5ff9c2", "sha256": "2d6c33006ffb8205d2d04a884f5c8bb35b16ebf51b4fc2bccce59dd651bde1bb" }, "downloads": -1, "filename": "rich-traceback-1.0.2.tar.gz", "has_sig": false, "md5_digest": "766f2b734d655424646f4f6e5e5ff9c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8590, "upload_time": "2015-06-11T06:56:25", "url": "https://files.pythonhosted.org/packages/2b/3d/3ebbb7c46f071493724580255bab494ee3402d6c50c9f5d701cb0648c51e/rich-traceback-1.0.2.tar.gz" } ] }