Module e.c.u.exception_hook

Part of elisa.core.utils

Exception handler that's able to extract detailled error informations and write them to a file.
Line # Kind Name Docs
28 Function format_failure Format a failure into a human readable string (containing line-breaks).
46 Function format_traceback Format a traceback into a human readable string (containing line-breaks).
68 Function write_to_logfile Write data to a new tempfile in the given logdir and return the path to
def format_failure(failure, detail='default'):
Format a failure into a human readable string (containing line-breaks).
Parametersfailurethe twisted failure that should get formatted (type: twisted.internet.python.failure.Failure )
detailthe detail-level, proxied to twisted.internet.python.failure.Failure.printTraceback (type: string )
Returnsthe formatted traceback. (type: string )
def format_traceback(*args):
Format a traceback into a human readable string (containing line-breaks). If three arguments are given, they are expected to be the type of the Exceptiong, the Exception itself and the Traceback-Object (in this order). If no values are given (or the length is not 3), use sys.exc_info() to get these informations.
Returnsthe formatted traceback. (type: string )
def write_to_logfile(data, logdir=None):
Write data to a new tempfile in the given logdir and return the path to the new file.
Parametersdatathe data to write down (type: string or unicode )
logdirthe path to the directory to log into. if None the default system temp dir is used. (type: string )
ReturnsThe path to the new file or None if it didn't work (type: string )
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.