futile.logger (version 1.4.3)

flog.carp: Always return the log message

Description

Indicate whether the logger will always return the log message despite the threshold.

Arguments

carp
logical Whether to carp output or not
name
character The name of the logger

Usage

# Indicate whether the given logger should carp flog.carp(name=ROOT) # Set whether the given logger should carp flog.carp(carp, name=ROOT)

Details

This is a special option to allow the return value of the flog.* logging functions to return the generated log message even if the log level does not exceed the threshold. Note that this minorly impacts performance when enabled. This functionality is separate from the appender, which is still bound to the value of the logger threshold.

Examples

Run this code
flog.carp(TRUE)
x <- flog.debug("Returns this message but won't print")
flog.carp(FALSE)
y <- flog.debug("Returns nothing and prints nothing")

Run the code above in your browser using DataLab