Skip to content

Instantly share code, notes, and snippets.

@zerc
Created September 17, 2013 16:12
Show Gist options
  • Save zerc/6596594 to your computer and use it in GitHub Desktop.
Save zerc/6596594 to your computer and use it in GitHub Desktop.
Логирование трейсбека. И даже не спрашивайте зачем мне это :D
def D(fn):
import traceback
filename = 'trace'
def _(*args, **kwargs):
try:
return fn(*args, **kwargs)
except:
traceback.print_exc(5, open(filename, 'w'))
raise
return _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment