'Emit a record.
First check if the underlying file has changed, and if it
has, close the old stream and reopen the file to get the
current stream.'

def emit(self, record):

    try:
        sres = os.stat(self.baseFilename)
    except FileNotFoundError:
        sres = None
    if ((not sres) or (sres[ST_DEV] != self.dev) or (sres[ST_INO] != self.ino)):
        if (self.stream is not None):
            self.stream.flush()
            self.stream.close()
            self.stream = None
            self.stream = self._open()
            self._statstream()
    logging.FileHandler.emit(self, record)
