Skip to contents

This function logs a message to the SeaSondeR logging system and also informs the message to the console. It prefixes the message with the name of the calling function.

Usage

seasonder_logAndMessage(msg, log_level = "info", calling_function = NULL, ...)

Arguments

msg

A character string indicating the message to be logged and informed.

log_level

A character string indicating the level of the log ("info", "error", "fatal"). Default is "info".

calling_function

Function where the condition occurred. If NULL (default), the code determines the caller.

...

Additional arguments passed to rlang::inform (if log_level="info") or rlang::warn (if log_level="error").

Value

Invisibly returns no value; used solely for its side effects of logging and messaging.

Examples

my_function <- function() {
  seasonder_logAndMessage("This is a message", "info")
}
my_function()
#> my_function: This is a message