              self._log(5, msg, args, **kwargs)
  
  
  class FaceswapFormatter(logging.Formatter):
      """ Override formatter to strip newlines from logger arguments """
      def format(self, record):
          if isinstance(record.msg, str) and ("\n" in record.msg or "\r" in record.msg):
              record.msg = record.msg.replace("\n", "\\n").replace("\r", "\\r")
          if any(self.reformat_check(arg) for arg in record.args):
              record.args = self.reformat_args(record.args)
 
</s> remove         if isinstance(record.msg, str) and ("\n" in record.msg or "\r" in record.msg):
            record.msg = record.msg.replace("\n", "\\n").replace("\r", "\\r")
        if any(self.reformat_check(arg) for arg in record.args):
            record.args = self.reformat_args(record.args)
        return super().format(record)

    @staticmethod
    def reformat_check(arg):
        """ Check if the argument should be reformatted
            The argument is a string with a line break
            The argument is a numpy array
        """
        return ((isinstance(arg, str) and ("\n" in arg or "\r" in arg))
                or isinstance(arg, ndarray))

    @staticmethod
    def reformat_args(args):
        """ Reformat args that require new lines removing """
        new_args = []
        for arg in args:
            if isinstance(arg, ndarray):
                # Convert numpy arrays to string for reformatting
                arg = str(ndarray)
            if isinstance(arg, str) and ("\n" in arg or "\r" in arg):
                arg = arg.replace("\n", "\\n").replace("\r", "\\r")
            new_args.append(arg)
        return tuple(new_args)
 </s> add         record.message = record.getMessage()
        # strip newlines
        if "\n" in record.message or "\r" in record.message:
            record.message = record.message.replace("\n", "\\n").replace("\r", "\\r")

        if self.usesTime():
            record.asctime = self.formatTime(record, self.datefmt)
        msg = self.formatMessage(record)
        if record.exc_info:
            # Cache the traceback text to avoid converting it multiple times
            # (it's constant anyway)
            if not record.exc_text:
                record.exc_text = self.formatException(record.exc_info)
        if record.exc_text:
            if msg[-1:] != "\n":
                msg = msg + "\n"
            msg = msg + record.exc_text
        if record.stack_info:
            if msg[-1:] != "\n":
                msg = msg + "\n"
            msg = msg + self.formatStack(record.stack_info)
        return msg </s> remove from numpy import ndarray

 </s> add  </s> remove     cmd = [im_ffm.get_ffmpeg_exe(), "-i", filename, "-map", "0:v:0", "-f", "null", "-"]
 </s> add     cmd = [im_ffm.get_ffmpeg_exe(), "-i", filename, "-map", "0:v:0"]
    if fast:
        cmd.extend(["-c", "copy"])
    cmd.extend(["-f", "null", "-"])
 </s> remove     int: The number of frames in the given video file.
 </s> add     int:
        The number of frames in the given video file.

    Example
    -------
    >>> filename = "/path/to/video.mp4"
    >>> frame_count = count_frames(filename) </s> remove     Unfortunately there is no guaranteed accurate way to get a count of video frames
    without iterating through the video.
 </s> add     There is no guaranteed accurate way to get a count of video frames without iterating through
    a video and decoding every frame.
    """ Override formatter to strip newlines the final message """

              self._log(5, msg, args, **kwargs)
  
  
  class FaceswapFormatter(logging.Formatter):
    """ Override formatter to strip newlines the final message """

      def format(self, record):
          if isinstance(record.msg, str) and ("\n" in record.msg or "\r" in record.msg):
              record.msg = record.msg.replace("\n", "\\n").replace("\r", "\\r")
          if any(self.reformat_check(arg) for arg in record.args):
              record.args = self.reformat_args(record.args)
keep keep keep keep replace keep keep keep keep keep
 lib.logger - Remove newlines from log messages 
lib/logger.py