lg <- get_logger("log/ger/test")
# equivalent to
lg <- get_logger(c("log", "ger", "test"))
lg$warn("a %s message", "warning")
lg
lg$parent
if (requireNamespace('glue')){
lg <- get_logger_glue("log/ger")
}
lg$warn("a {.text} message", .text = "warning")
# completely reset 'glue' to an unconfigured vanilla Logger
get_logger("log/ger", reset = TRUE)
# WARNING: this invalidates existing references to the Logger
try(lg$info("lg has been invalidated an no longer works"))
lg <- get_logger("log/ger")
lg$info("now all is well again")
Run the code above in your browser using DataLab