This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Informative Traceback Logging for Python

Informative stack traces showing method parameters. Simple standalone logger with console syslog support.

Usage:

  • If you’re already using the logging module, import rich_traceback.enable in your module. Then logger.exception() will report nicely formatted exceptions.

import rich_traceback.enable

  • Otherwise, create a new logger using the RichTracebackFormatter class, or see rich_traceback.log as an example:

(save as test.py)

from rich_traceback.formatter import RichTracebackFormatter
import logging
logger = logging.getLogger('root')
console_log = logging.StreamHandler()
console_log.setFormatter(RichTracebackFormatter())
logger.addHandler(console_log)

def foo(x=3):
    if 1.0/x:
        foo(x-1)

try:
    foo()
except:
    logger.exception("error running foo")

print "compare with standard Python traceback"
foo() # for standard traceback
$ python test.py

ERROR root test.<module>:15 error running foo
<type 'exceptions.ZeroDivisionError'>: ZeroDivisionError('float division by zero',) ([5] frames following)
[4] test.py, foo(x=0) at line 9: if 1.0/x:
[3] test.py, foo(x=1) at line 10: foo(x-1)
[2] test.py, foo(x=2) at line 10: foo(x-1)
[1] test.py, foo(x=3) at line 10: foo(x-1)
[0] test.py, <module>() at line 13: foo()

compare with standard Python traceback
Traceback (most recent call last):
  File "test.py", line 18, in <module>
    foo()
  File "test.py", line 10, in foo
    foo(x-1)
  File "test.py", line 10, in foo
    foo(x-1)
  File "test.py", line 10, in foo
    foo(x-1)
  File "test.py", line 9, in foo
    if 1.0/x:
ZeroDivisionError: float division by zero

For a global exception trap, see enable.py

Release History

Release History

1.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
rich_traceback-1.0.2-py2-none-any.whl (6.6 kB) Copy SHA256 Checksum SHA256 py2 Wheel Jun 11, 2015
rich-traceback-1.0.2.tar.gz (8.6 kB) Copy SHA256 Checksum SHA256 Source Jun 11, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting