I\'m writing a custom logging system for a project. If a function throws an exception, I want to log its local variables. Is it possible to access the raising function\'s
try: myfunction() except: import sys type, value, tb = sys.exc_info() while tb.tb_next: tb = tb.tb_next frame = tb.tb_frame print frame.f_locals['v1']