Julython is on!
Tracerlib is a set of utilities to make tracing Python code easier.
It provides TracerManager, which can allow multiple trace functions to
coexist. It can easily be enabled and disabled, either manually or as a
context manager in a with statement.
Tracer classes make handling the different trace events much easier.
class TraceExceptions(Tracer):
def trace_exception(self, func_name, exctype, value, tb):
print "Saw an exception: %r" % (value,)
inspector = FrameInspector(sys._getframe())
print "Called", inspector.func_name
print "args:", inspector.args
print "kwargs:", inspector.kwargs
You can read the full documentation at the read the docs site and see the code at github.