Learn R Programming

logger (version 0.4.3)

log_errors: Injects a logger call to standard errors

Description

This function sets a hook to trigger log_error() when stop() is called to log the error messages with the global logger layout and appender.

Usage

log_errors(
  muffle = getOption("logger_muffle_errors", FALSE),
  traceback = FALSE
)

Arguments

muffle

if TRUE, the error is not thrown after being logged

traceback

if TRUE the error traceback is logged along with the error message

Examples

Run this code
if (FALSE) {
log_errors()
stop("foobar")
}

Run the code above in your browser using DataLab