How can I log my Python errors?
try: do_something() except: # How can I log my exception here, complete with its traceback?
What I was looking for:
import sys import traceback exc_type, exc_value, exc_traceback = sys.exc_info() traceback_in_var = traceback.format_tb(exc_traceback)
See: