Initializes a logger with a given logfile.
Usage
create_logger(
my_logfile,
threshold = c("INFO", "DEBUG", "WARNING", "ERROR", "FATAL"),
console = FALSE
)
Arguments
- my_logfile
path to the log file (character).
- threshold
logging levels to write to the logger (see
loglevel
documentation inlog4r
). Defalts toINFO
.- console
Write log messages to console?
Value
Returns a logger and creates a logfile at the given path. If the path given does not exist, also creates this path.
Examples
logger <- create_logger(tempfile())
#> Create logger /tmp/Rtmp3MYUYp/file6d2b2f2bf0df