log_errors: Injects a logger call to standard errors

View source: R/hooks.R

log_errorsR Documentation

Injects a logger call to standard errors

Description

This function uses trace() to add a log_error() function call when stop() is called to log the error messages with the 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

## Not run: 
log_errors()
stop("foobar")

## End(Not run)

daroczig/logger documentation built on Jan. 31, 2025, 6:56 p.m.