def METHOD_NAME(self, handler_name: str, file: IO[str]):
    for handler in self._logger.handlers:
        if handler.name == handler_name:
            handler.stream = file
            return
    raise ValueError(f"Logger does not have a handler named '{handler_name}'")