Log information with time stamp accounting for message type.
Message type will point toward the most appropriate cli function display.
Arguments
- msg
Character values of message to log that leverages
cliformatting.- type
Name of the message type to toward best
clidisplay:"info": usescli::cli_alert_info()"success": usescli::cli_alert_success()"h1": usescli::cli_h1()"h2": usescli::cli_h2()"h3": usescli::cli_h3()"text": usescli::cli_text()"alert": usescli::cli_alert()"li": usescli::cli_li()"ol": usescli::cli_ol()"progress_step": usescli::cli_progress_step()
Examples
# Log information
logInfo(cliFormat("This is an {.strong info} message"))
#> ℹ Info [21/11/2025 - 14:06:16]: This is an info message
#>
# Log a title
logInfo(cliFormat("Task: {.strong tic toc test}"), type = "h1")
#>
#> ── Task: tic toc test ──────────────────────────────────────────────────────────
# Log success
t0 <- tic()
Sys.sleep(3)
logInfo(cliFormat("Task: {.strong tic toc test} completed [{toc(t0, \"s\")}]"), type = "success")
#> ✔ Info [21/11/2025 - 14:06:19]: Task: tic toc test completed [3.0 s]
#>