"John Hunter" <jd******@ace.bsd.uchicago.edu> wrote in message
news:ma*************************************@pytho n.org...
What is the best way to get the traceback as a string.
I define the following module "Excepts.py" for logging exceptions in daemon
processes:
------------------------------------------
import sys,traceback
def error():
tb =
traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info(
)[2])
return tb[len(tb)-1].replace('\n','')
def errorstack():
return
''.join(traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.e
xc_info()[2]))
-------------------------------------------
Colin Brown
PyNZ