R/utils.R

Defines functions .maybe_alert

Documented in .maybe_alert

#' Filter Alerts through a Verbose Flag
#'
#' @param verbose A logical scalar indicating whether to show the alert.
#' @param ... Additional parameters passed on to [cli::cli_alert()].
#'
#' @keywords internal
.maybe_alert <- function(verbose = TRUE, ...) {
  if (verbose) {
    cli::cli_alert(..., .envir = rlang::caller_env())
  }
}
macmillancontentscience/torchtransformers documentation built on Aug. 6, 2023, 5:35 a.m.