def on_IOError ( self , e ) : sys . stderr . write ( "Error: %s: \"%s\"\n" % ( e . strerror , e . filename ) )
how to log error is python
Handle an IOError exception .
def on_IOError(self, e):
        """ Handle an IOError exception. """

        sys.stderr.write("Error: %s: \"%s\"\n" % (e.strerror, e.filename))