Allen Fowler wrote:
> In the error log, I would like to record a stacktrace and various local 
> variables that existed in subX at the time the Exception was thrown... 

The stack trace is easy - add the parameter exc_info=True to the logging 
call, e.g.
   logging.error('Oops!', exc_info=True)

When you to this the traceback is included in the log message.

For the local variables, you have to do some work yourself. You might 
look at IPython, it has an option to show local variables in the 
post-mortem stack traces, maybe you could take some code from there. See 
the ultraTB module.

Kent
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to