log_warnings: Injects a logger call to standard warnings

View source: R/hooks.R

log_warningsR Documentation

Injects a logger call to standard warnings

Description

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

Usage

log_warnings(muffle = getOption("logger_muffle_warnings", FALSE))

Arguments

muffle

if TRUE, the warning is not shown after being logged

Examples

## Not run: 
log_warnings()
for (i in 1:5) {
  Sys.sleep(runif(1))
  warning(i)
}

## End(Not run)

logger documentation built on May 10, 2026, 9:06 a.m.