CreateTimeStampCliEnv: Create Environment with Timestamped CLI Functions

View source: R/10_ts_cli.R

CreateTimeStampCliEnvR Documentation

Create Environment with Timestamped CLI Functions

Description

Generates an environment containing wrapped versions of common CLI functions that automatically include timestamps in their output. This provides a convenient way to use multiple CLI functions with consistent timestamping.

Usage

CreateTimeStampCliEnv(
  cli_functions = c("cli_alert_info", "cli_alert_success", "cli_alert_warning",
    "cli_alert_danger")
)

Arguments

cli_functions

from package cli to be wrapped with timestamp functionality.

Details

This function creates a new environment and populates it with timestamped versions of commonly used CLI functions from the cli package. Only functions that exist in the loaded cli package are added to the environment. The function uses walk for side-effect iteration over the function names.

Value

Returns an environment containing timestamp-wrapped versions of:

  • cli_warn

  • cli_alert_info

  • cli_alert_success

  • cli_alert_warning

  • cli_alert_danger

Each function in the environment will automatically prepend timestamps to its output messages.

See Also

AddTimeStamp2cli for the wrapper function used internally.

Other TimeStamp: AddTimeStamp2cli(), TimeStamp()

Examples

## Not run: 
# Create environment with timestamped CLI functions
cli_env <- CreateTimeStampCliEnv()

# Use timestamped functions
cli_env$cli_alert_info("System started")
cli_env$cli_alert_success("Operation completed")

## End(Not run)


SigBridgeRUtils documentation built on Sept. 29, 2026, 5:09 p.m.