def METHOD_NAME(*args: Any, **kwargs: Any) -> Any:
    logdir = (
        kwargs["logdir"].numpy().decode("utf8")
        if hasattr(kwargs["logdir"], "numpy")
        else kwargs["logdir"]
    )
    logdir_hist.append(logdir)
    root_logdir_arg = root_logdir
    if len(set(logdir_hist)) > 1 and root_logdir == "":
        wandb.termwarn(
            "When using several event log directories, "
            'please call `wandb.tensorboard.patch(root_logdir="...")` before `wandb.init`'
        )
    # if the logdir contains the hostname, the writer was not given a logdir.
    # In this case, the generated logdir
    # is generated and ends with the hostname, update the root_logdir to match.
    hostname = socket.gethostname()
    search = re.search(rf"-\d+_{hostname}", logdir)
    if search:
        root_logdir_arg = logdir[: search.span()[1]]
    elif root_logdir is not None and not os.path.abspath(logdir).startswith(
        os.path.abspath(root_logdir)
    ):
        wandb.termwarn(
            "Found log directory outside of given root_logdir, "
            f"dropping given root_logdir for event file in {logdir}"
        )
        root_logdir_arg = ""
    _notify_tensorboard_logdir(logdir, save=save, root_logdir=root_logdir_arg)
    return old_csfw_func(*args, **kwargs)