Skip to main content
Help us improve Python packaging – donate today!

Rich Traceback Logger

Project Description

Informative Traceback Logging for Python

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


  • 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

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

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

    logger.exception("error running foo")

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

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

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

For a global exception trap, see

Release history Release notifications

This version
History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
rich_traceback-1.0.2-py2-none-any.whl (6.6 kB) Copy SHA256 hash SHA256 Wheel py2 Jun 11, 2015
rich-traceback-1.0.2.tar.gz (8.6 kB) Copy SHA256 hash SHA256 Source None Jun 11, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page