Prints a message to the console with a consistent tidyomics style. A package-specific prefix is automatically added based on the calling package name, followed by the message text. Different message types are displayed using appropriate styles from the cli package.
A character string containing the message to display.
The type of message to display. One of
"info", "success", "warning", or "danger".
Defaults to "info".
How often the message should be displayed. One of
"always" (default), "regularly" (once every 8 hours),
or "once" (once per R session). Passed to
rlang::inform().
A unique identifier used to recognise the same
message when frequency is not "always". Required in
that case; see rlang::inform().
Invisibly returns NULL. Called for side effects (printing
a styled message to the console).
Frequency control uses the tidyverse messaging API
(cli::cli_inform() / rlang::inform()). Use frequency = "once"
to show a message once per R session.
tidy_message("Loading data...", type = "info")
#> ℹ Console says: Loading data...
tidy_message("Data loaded successfully!", type = "success")
#> ✔ Console says: Data loaded successfully!
tidy_message("Shown once per session.", type = "warning",
frequency = "once", frequency_id = "example-once")
#> ! Console says: Shown once per session.
#> This message is displayed once per session.