Learn R Programming

lgr (version 0.4.4)

Layout: Abstract Class for Layouts

Description

Abstract Class for Layouts

Abstract Class for Layouts

Arguments

Notes for developers

Layouts may have an additional $read(file, threshold, n) method that returns a character vector, and/or an $parse(file) method that returns a data.frame. These can be used by Appenders to $show() methods and $data active bindings respectively (see source code of AppenderFile).

Methods


Method format_event()

Format a log event

Function that the Layout uses to transform a LogEvent into something that an Appender can write to an output destination.

Usage

Layout$format_event(event)

Arguments

event

a LogEvent


Method toString()

Usage

Layout$toString()


Method clone()

The objects of this class are cloneable with this method.

Usage

Layout$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Appenders pass LogEvents to a Layout which formats it for output. For the Layouts included in lgr that means turning the LogEvent into a character string.

For each Appender exist one more more possible Layouts, but not every Layout will work with every Appender. See the package lgrExtra for examples for Layouts that return different data types (such as data.frames) and Appenders that can handle them.

See Also

Other Layouts: LayoutFormat, LayoutGlue, LayoutJson