Description Active bindings Methods Examples
Class to provide logging capabilities
Class to provide logging capabilities
fileSet or get the file path of the logger
custom_sanitizerget, replace or add custom sanitizer rules to the default sanitizer
default_sanitizerget the default sanitizer rules
new()initialize a new logger with logger$new("file_path")
logger$new(file = NULL)
filefile path to log file that already exists or should be created (optional)
##create a new log
log1 <- logger$new()
log2 <- logger$new("log1.log")
add()add a log entry to the logging file
logger$add(log_lvl, log_msg, ..., echo = T)
log_lvlcharacter string for the log level to record the log entry for
log_msglog message to record
...custom named values to record in the log
echoOverriding echo = T argument
## add a log record log1$add(log_lvl = "debug", log_msg = "some information")
warn()add a log entry with "warn" as the log_lvl
logger$warn(log_msg, ..., echo = T)
log_msglog message to record
...custom named values to record in the log
echoOverriding echo = T argument
info()add a log entry with "info" as the log_lvl
logger$info(log_msg, ..., echo = T)
log_msglog message to record
...custom named values to record in the log
echoOverriding echo = T argument
err()add a log entry with "err" as the log_lvl
logger$err(log_msg, ..., echo = T)
log_msglog message to record
...custom named values to record in the log
echoOverriding echo = T argument
return_log()return the log as a tibble
logger$return_log()
clone()The objects of this class are cloneable with this method.
logger$clone(deep = FALSE)
deepWhether to make a deep clone.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## ------------------------------------------------
## Method `logger$new`
## ------------------------------------------------
##create a new log
log1 <- logger$new()
log2 <- logger$new("log1.log")
## ------------------------------------------------
## Method `logger$add`
## ------------------------------------------------
## add a log record
log1$add(log_lvl = "debug", log_msg = "some information")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.