lgr (version 0.3.3)

Filterable: Abstract Class for Filterables

Description

Abstract classes are exported for package developers that want to extend them, they cannot be instantiated directly.

Superclass for classes that have a filter() method such as Appenders and Loggers. This class is only exported for package developers that want to extend it.

Usage

Filterable

.obj()

Arguments

Format

An object of class R6ClassGenerator of length 24.

Fields

filters, set_filters(filters)

a list that may contain functions or any R object with a filter() method. These functions must have exactly one argument: event which will get passed the LogEvent when the Filterable's filter() method is invoked. If all of these functions evaluate to TRUE the LogEvent is passed on. Since LogEvents have reference semantics, filters can also be abused to modify them before they are passed on. Look at the source code of with_log_level() or with_log_value() for examples.

Methods

filter(event)

Determine whether the LogEvent x should be passed on to Appenders (TRUE) or not (FALSE). See also the active binding filters

add_filter(filter, name = NULL), remove_filter(pos)

Add or remove a filter. When adding a filter an optional name can be specified. remove_filter() can remove by position or name (if one was specified)

See Also

Other abstract classes: AppenderDigest, AppenderMail, AppenderMemory, AppenderTable