      -------
      :class:`logging.RotatingFileHandler`
          The logging file handler
      """
      if log_file is not None:
          filename = log_file
      else:
          filename = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "faceswap")
          # Windows has issues sharing the log file with sub-processes, so log GUI separately
          filename += "_gui.log" if command == "gui" else ".log"
 
</s> remove         parent_flags = dict(mask_toggle="request_mask_toggle", update="request_refresh")
        for trigger in ("mask_toggle", "update"):
            filename = self._gui_triggers[trigger]
 </s> add         for trigger, filename in self._gui_triggers.items(): </s> remove             return
 </s> add             return retval </s> remove 
 </s> add                 retval[trigger] = True </s> remove     def _process_gui_triggers(self) -> None:
        """ Check whether a file drop has occurred from the GUI to manually update the preview. """
 </s> add     def _process_gui_triggers(self) -> Dict[Literal["mask", "refresh"], bool]:
        """ Check whether a file drop has occurred from the GUI to manually update the preview.

        Returns
        -------
        dict
            The trigger name as key and boolean as value
        """
        retval: Dict[Literal["mask", "refresh"], bool] = {key: False for key in self._gui_triggers} </s> remove 
        logger.debug("Preview window keypress '%s' received", key)
        if key == "r":
            print("\n")  # Let log print on different line from loss output
            logger.info("Refresh preview requested...")

        with self._lock:
            if key == "f":
                self._toggle_size()
            else:
                self._triggers[self._callbacks[key]] = True

    def _on_resize(self,
                   event: backend_bases.ResizeEvent) -> None:  # noqa # pylint:disable=unused-argument
        """ If the display is set to `actual size` then the image needs to be resized on any window
        resize event. """
        for fig, size in self._images.values():
            fig.set_size_inches(size)

    def _on_close(self,
                   event: backend_bases.CloseEvent) -> None:  # noqa # pylint:disable=unused-argument
        """ Force an update when the figure has been closed to relaunch it. """
        logger.debug("Preview close detected")
        with self._lock:
            self._needs_update = True
 </s> add         logger.debug("Sending shutdown to preview viewer")
        self._triggers["shutdown"].set()
    if log_file:
      -------
      :class:`logging.RotatingFileHandler`
          The logging file handler
      """
    if log_file:
          filename = log_file
      else:
          filename = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "faceswap")
          # Windows has issues sharing the log file with sub-processes, so log GUI separately
          filename += "_gui.log" if command == "gui" else ".log"
keep keep keep keep replace keep keep keep keep keep
 Training - Use custom preview pop-out 
lib/logger.py