Mega Code Archive

 
Categories / Python Tutorial / Buildin Module
 

Redirecting Error Information

import sys  fsock = open('error.log', 'w')                 sys.stderr = fsock                                  raise Exception, 'this error will be logged'