def METHOD_NAME(
    self, handler_name: str, file: IO[str], formatter: logging.Formatter
):
    # check if there's a handler by this name
    for handler in self._logger.handlers:
        if handler.name == handler_name:
            self._logger.removeHandler(handler)
            break
    # create a stream handler from the file
    stream_handler = logging.StreamHandler(file)
    stream_handler.name = handler_name
    # set the formatter
    stream_handler.setFormatter(formatter)
    # add the handler to the logger
    self._logger.addHandler(stream_handler)