Skip to content

Instantly share code, notes, and snippets.

@hexsprite
Created February 24, 2014 17:46
Show Gist options
  • Select an option

  • Save hexsprite/9193161 to your computer and use it in GitHub Desktop.

Select an option

Save hexsprite/9193161 to your computer and use it in GitHub Desktop.
Python tracing decorator
def trace(fun):
def decorated(*args, **kwargs):
import traceback
print '-' * 20
print repr(fun), "\n"
print "args=", repr(args), "kwargs=", repr(kwargs)
traceback.print_stack()
print '-' * 20
return fun(*args, **kwargs)
return decorated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment