Always return the log message

Share:

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

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.

Usage

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

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

Author(s)

Brian Lee Yung Rowe

Examples

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