Print diagnostic message

log_message(..., verbose = TRUE, message_type = "info", cli_model = TRUE)

Arguments

...

Text to print.

verbose

Logical value, default is TRUE. Whether to print the message.

message_type

Type of message, default is info. Could be choose one of info, warning, and error.

cli_model

Logical value, default is TRUE. Whether to use the cli package to print the message. Add because the message is printed by message, the message could be suppressed by suppressMessages.

Examples

log_message("Hello, ", "world!")
#>  Hello, world!
suppressMessages(log_message("Hello, ", "world!"))
log_message("Hello, world!", verbose = FALSE)
log_message("Hello, world!", verbose = TRUE, message_type = "warning")
#> ! Warning: Hello, world!