def emit(self, record):
        """
        Emit a record.

        Override from parent class to handle file locking for the duration of rollover and write.
        This also does the formatting *before* locks are obtained, in case the format itself does
        logging calls from within. Rollover also occurs while the lock is held.
        """
        # noinspection PyBroadException
        try:
            msg = self.format(record)
            try:
                self._do_lock()

                try:
                    if self.shouldRollover(record):
                        self.doRollover()
                except Exception as e:
                    self._console_log("Unable to do rollover: %s" % (e,), stack=True)
                    # Continue on anyway

                self.do_write(msg)

            finally:
                self._do_unlock()
        except Exception:
            self.handleError(record)
def emit ( self , record ) : try : msg = self . format ( record ) try : self . _do_lock ( ) try : if self . shouldRollover ( record ) : self . doRollover ( ) except Exception as e : self . _console_log ( "Unable to do rollover: %s" % ( e , ) , stack = True ) self . do_write ( msg ) finally : self . _do_unlock ( ) except Exception : self . handleError ( record )
Emit a record.

        Override from parent class to handle file locking for the duration of rollover and write.
        This also does the formatting *before* locks are obtained, in case the format itself does
        logging calls from within. Rollover also occurs while the lock is held.