FilterForceLevel {lgr} | R Documentation |
Override the log level of all events processed by a Logger/Appender
Description
Overrides the log level of the Appender/Logger that this filter
is attached to to with level
. See also with_log_level()
. It is
recommended to use filters that modify LogEvents only with Loggers, but
they will also work with Appenders.
Super class
lgr::EventFilter
-> FilterForceLevel
Public fields
Methods
Public methods
Method new()
Initialize a new FilterForceLevel
Usage
FilterForceLevel$new(level)
Arguments
level
an
integer
orcharacter
log level
Method clone()
The objects of this class are cloneable with this method.
Usage
FilterForceLevel$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
lg <- get_logger("test")
analyse <- function(){
lg$add_filter(FilterForceLevel$new("info"), "force")
on.exit(lg$remove_filter("force"))
lg$error("an error with forced log level INFO")
}
analyse()
lg$error("an normal error")
lg$config(NULL) # reset config
[Package lgr version 0.4.4 Index]