Debian Codegraph @

man/Layout.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/Layout.R
3 \name{Layout}
4 \alias{Layout}
5 \alias{Layouts}
6 \title{Abstract Class for Layouts}
7 \description{
8 Abstract Class for Layouts
9
10 Abstract Class for Layouts
11 }
12 \details{
13 \link{Appenders} pass \link[=LogEvent]{LogEvents} to a Layout which formats it for
14 output. For the Layouts included in lgr that means turning the LogEvent
15 into a \code{character} string.
16
17 For each Appender exist one more more possible Layouts, but not every Layout
18 will work with every Appender. See the package \pkg{lgrExtra} for examples
19 for Layouts that return different data types (such as \code{data.frames}) and
20 Appenders that can handle them.
21 }
22 \section{Notes for developers}{
23
24 Layouts may have an additional \verb{$read(file, threshold, n)} method that returns
25 a \code{character} vector, and/or an \verb{$parse(file)} method that
26 returns a \code{data.frame}. These can be used by Appenders to \verb{$show()} methods
27 and \verb{$data} active bindings respectively (see source code of \link{AppenderFile}).
28 }
29
30 \seealso{
31 Other Layouts:
32 \code{\link{LayoutFormat}},
33 \code{\link{LayoutGlue}},
34 \code{\link{LayoutJson}}
35 }
36 \concept{Layouts}
37 \section{Active bindings}{
38 \if{html}{\out{<div class="r6-active-bindings">}}
39 \describe{
40 \item{\code{excluded_fields}}{fields to exclude from the final log}
41 }
42 \if{html}{\out{</div>}}
43 }
44 \section{Methods}{
45 \subsection{Public methods}{
46 \itemize{
47 \item \href{#method-Layout-format_event}{\code{Layout$format_event()}}
48 \item \href{#method-Layout-toString}{\code{Layout$toString()}}
49 \item \href{#method-Layout-set_excluded_fields}{\code{Layout$set_excluded_fields()}}
50 \item \href{#method-Layout-clone}{\code{Layout$clone()}}
51 }
52 }
53 \if{html}{\out{<hr>}}
54 \if{html}{\out{<a id="method-Layout-format_event"></a>}}
55 \if{latex}{\out{\hypertarget{method-Layout-format_event}{}}}
56 \subsection{Method \code{format_event()}}{
57 Format a log event
58
59 Function that the Layout uses to transform a \link{LogEvent} into something
60 that an \link{Appender} can write to an output destination.
61 \subsection{Usage}{
62 \if{html}{\out{<div class="r">}}\preformatted{Layout$format_event(event)}\if{html}{\out{</div>}}
63 }
64
65 \subsection{Arguments}{
66 \if{html}{\out{<div class="arguments">}}
67 \describe{
68 \item{\code{event}}{a \link{LogEvent}}
69 }
70 \if{html}{\out{</div>}}
71 }
72 }
73 \if{html}{\out{<hr>}}
74 \if{html}{\out{<a id="method-Layout-toString"></a>}}
75 \if{latex}{\out{\hypertarget{method-Layout-toString}{}}}
76 \subsection{Method \code{toString()}}{
77 \subsection{Usage}{
78 \if{html}{\out{<div class="r">}}\preformatted{Layout$toString()}\if{html}{\out{</div>}}
79 }
80
81 }
82 \if{html}{\out{<hr>}}
83 \if{html}{\out{<a id="method-Layout-set_excluded_fields"></a>}}
84 \if{latex}{\out{\hypertarget{method-Layout-set_excluded_fields}{}}}
85 \subsection{Method \code{set_excluded_fields()}}{
86 \subsection{Usage}{
87 \if{html}{\out{<div class="r">}}\preformatted{Layout$set_excluded_fields(x)}\if{html}{\out{</div>}}
88 }
89
90 }
91 \if{html}{\out{<hr>}}
92 \if{html}{\out{<a id="method-Layout-clone"></a>}}
93 \if{latex}{\out{\hypertarget{method-Layout-clone}{}}}
94 \subsection{Method \code{clone()}}{
95 The objects of this class are cloneable with this method.
96 \subsection{Usage}{
97 \if{html}{\out{<div class="r">}}\preformatted{Layout$clone(deep = FALSE)}\if{html}{\out{</div>}}
98 }
99
100 \subsection{Arguments}{
101 \if{html}{\out{<div class="arguments">}}
102 \describe{
103 \item{\code{deep}}{Whether to make a deep clone.}
104 }
105 \if{html}{\out{</div>}}
106 }
107 }
108 }