print(('Value', exc_value))
print(('Tb', ''.join(traceback.format_tb(exc_tb))))

def custom_excepthook(exc_type, exc_value, exc_tb):
    report_exception(exc_type, exc_value, exc_tb)
sys.__excepthook__(exc_type, exc_value, exc_tb)
sys.excepthook = custom_excepthook
raise RuntimeError('I want to report exception here...')
Is it possible to capture any traceback generated by a Python application?