Printing Stack Trace
Wednesday, May 9th, 2007Useful for printing out the stack trace when debugging calls within Zope code:
items = traceback.extract_stack()
for stackItem in items:
msg = ‘ %s:%s:’ % (os.path.basename(stackItem[0]), stackItem[1])
logger.warn(’%s:’ % msg)