def METHOD_NAME(self, record):
    try:
        if record.levelno == logging.INFO:
            stream = self._stdout
            msg = six.ensure_text(record.getMessage())
            if self._stdout_waiting == self.INTERRUPTED and self._same_output:
                msg = " ... %s" % msg
            self._stdout_waiting = msg.endswith("... ")
            if msg.endswith("... "):
                self._stdout_waiting = self.WAITING
            else:
                self._stdout_waiting = None
                msg = "%s\n" % msg
        elif record.levelno < logging.INFO and self._keep_if_debug != self.PRINT:
            if self._keep_if_debug == self.KEEP:
                self._debug.append(record)
            return
        else:
            if record.levelno >= logging.ERROR and len(self._debug):
                self._emit_queue()
            if self._stdout_waiting == self.WAITING and self._same_output:
                self._stdout_waiting = self.INTERRUPTED
                self._stdout.write("\n")
                self._stdout.flush()
            stream = self._stderr
            msg = "%s\n" % self.format(record)
        stream.write(msg)
        stream.flush()
    except (KeyboardInterrupt, SystemExit, IOError):
        raise
    except Exception:
        self.handleError(record)