View source: R/24_caller_cli.R
| CreateCallerCliEnv | R Documentation |
Generates an environment containing CLI functions that automatically report their caller (Global or Function Name).
CreateCallerCliEnv(
cli_functions = c("cli_alert_info", "cli_alert_success", "cli_alert_warning",
"cli_alert_danger", "cli_inform")
)
cli_functions |
Character vector of function names from package |
An environment with wrapped functions.
## Not run:
caller_cli <- CreateCallerCliEnv()
# Global context
caller_cli$cli_alert_info("Hello")
# Output: [global]: Hello
# Function context
f <- function(x) { caller_cli$cli_alert_success("Result is {x}") }
f(100)
# Output: [f()]: Result is 100
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.