NOTE: This is an abstract class. Abstract classes cannot be instantiated directly, but are exported for package developers that want to extend lgr - for example by creating their own Appenders or Layouts. Please refer to the see also section for actual implementations of this class.
AppenderMemory is extended by Appenders that retain an in-memory event
buffer, such as AppenderBuffer and AppenderPushbullet
from the
lgrExtra package.
See also
Other abstract classes:
Appender
,
AppenderTable
,
Filterable
Super classes
lgr::Filterable
-> lgr::Appender
-> AppenderMemory
Active bindings
flush_on_exit
A
logical
scalar. Should the buffer be flushed if the Appender is destroyed (e.g. because the R session is terminated)?flush_on_rotate
A
logical
scalar. Should the buffer be flushed when it is rotated because$buffer_size
is exceeded?should_flush
A
function
with exactly one arguments:event
.$append()
calls this function internally on the current LogEvent and flushes the buffer if it evaluates toTRUE
.buffer_size
integer
scalar>= 0
. Maximum number of LogEvents to buffer.flush_threshold
A
numeric
orcharacter
threshold. LogEvents with a log_level equal to or lower than this threshold trigger flushing the buffer.buffer_events
A
list
of LogEvents. Contents of the buffer.buffer_events
A
data.frame
. Contents of the buffer converted to adata.frame
.buffer_events
A
data.frame
. Contents of the buffer converted to adata.table
.
Methods
Method new()
Usage
AppenderMemory$new(...)
Method append()
Method flush()
Sends the buffer's contents to all attached Appenders and then clears the Buffer
Method set_buffer_size()
Set the maximum size of the buffer
Arguments
x
an
integer
scalar>= 0
. Number of LogEvents to buffer.
Method set_flush_threshold()
Set threshold that triggers flushing
Arguments
level
A
numeric
orcharacter
threshold. See active bindings.
Method show()
Display the contents of the log table. Relies on the
$format_event
method of the Layout attached to this Appender.