Print a message based on the level of verbosity

print_msg(msg, msg_type = c("INFO", "DEBUG", "WARNING", "STOP"))

Arguments

msg

The message to be printed

msg_type

The type of message, one of "INFO", "DEBUG", or "WARNING"

Value

None

Examples

opt_warn <- options()$warn
set_verbosity(1)
print_msg("Hello world!", "INFO")
#> |-- INFO :  Hello world! 
set_verbosity(3)
print_msg("Debugging message", "DEBUG")
#> |-- DEBUG :  Debugging message 
set_verbosity(0)
print_msg("Hello world!", "INFO")
print_msg("Debugging message", "DEBUG")
options(warn=-1)
print_msg("A warning message not displayed", "WARNING")
options(warn=opt_warn)