| AddTimeStamp2cli | R Documentation |
A higher-order function that wraps CLI functions to automatically prepend timestamps to their output messages. This creates a modified version of any CLI function that includes timestamp information in its output.
AddTimeStamp2cli(cli_func)
cli_func |
A CLI function from the |
This function uses force to ensure the CLI function is evaluated
at creation time. The timestamp is generated using a TimeStamp() function
which should be available in the execution environment and is inserted using
cli's glue-like syntax "{ }".
Returns a modified version of the input function that automatically
adds a timestamp in the format "[{timestamp}]" to the beginning
of all character messages passed to it.
CreateTimeStampCliEnv for creating a complete environment
of timestamped CLI functions.
Other TimeStamp:
CreateTimeStampCliEnv(),
TimeStamp()
## Not run:
# Create a timestamp-enabled version of cli_alert_info
timestamp_alert <- AddTimeStamp2cli(cli::cli_alert_info)
timestamp_alert("This message will have a timestamp")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.