https://github.com/apache/airflow/blob/main/airflow/cli/commands/task_command.py#L145
"""Propagate message removing escape codes."""
        self.logger.log(self.level, remove_escape_codes(message))
    def write(self, message):
        """
        Do whatever it takes to actually log the specified logging record.
        :param message: message to log
        """
        if not message.endswith("\n"):
            self._buffer += message
        else:
            self._buffer += message.rstrip()
            self.flush()
    def flush(self):
        """Ensure all logging output has been flushed."""
        buf = self._buffer
        if buf:
            self._buffer = ""
            self._propagate_log(buf)
    def isatty(self):
        """
        Return False to indicate the fd is not connected to a tty(-like) device.
        For compatibility reasons.
        """
        return False
class RedirectStdHandler(StreamHandler):