| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/Appender.R |
| 3 |
\name{Appender} |
| 4 |
\alias{Appender} |
| 5 |
\alias{Appenders} |
| 6 |
\title{Appenders} |
| 7 |
\description{ |
| 8 |
Appenders are attached to \link{Loggers} and manage the output of the |
| 9 |
\link{LogEvents} to a destination - such as the console or a text file. An |
| 10 |
Appender has a single \link{Layout} that tells it how to format the LogEvent. For |
| 11 |
details please refer to the documentations of the specific Appenders. |
| 12 |
|
| 13 |
Additional Appenders that support a wide range of output destinations - |
| 14 |
such as databases, email, push-notifications or Linux syslog - are available |
| 15 |
from the package \href{https://github.com/s-fleck/lgrExtra}{lgrExtra}. |
| 16 |
|
| 17 |
\strong{NOTE}: This is an \emph{abstract class}. Abstract classes cannot be instantiated |
| 18 |
directly, but are exported for package developers that want to extend lgr - |
| 19 |
for example by creating their own \link[=Appender]{Appenders} or \link[=Layout]{Layouts}. |
| 20 |
Please refer to the \emph{see also} section for actual implementations of this |
| 21 |
class. |
| 22 |
} |
| 23 |
\seealso{ |
| 24 |
Other abstract classes: |
| 25 |
\code{\link{AppenderMemory}}, |
| 26 |
\code{\link{AppenderTable}}, |
| 27 |
\code{\link{Filterable}} |
| 28 |
|
| 29 |
Other Appenders: |
| 30 |
\code{\link{AppenderBuffer}}, |
| 31 |
\code{\link{AppenderConsole}}, |
| 32 |
\code{\link{AppenderFile}}, |
| 33 |
\code{\link{AppenderFileRotating}}, |
| 34 |
\code{\link{AppenderFileRotatingDate}}, |
| 35 |
\code{\link{AppenderFileRotatingTime}}, |
| 36 |
\code{\link{AppenderTable}} |
| 37 |
} |
| 38 |
\concept{Appenders} |
| 39 |
\concept{abstract classes} |
| 40 |
\keyword{internal} |
| 41 |
\section{Super class}{ |
| 42 |
\code{\link[lgr:Filterable]{lgr::Filterable}} -> \code{Appender} |
| 43 |
} |
| 44 |
\section{Active bindings}{ |
| 45 |
\if{html}{\out{<div class="r6-active-bindings">}} |
| 46 |
\describe{ |
| 47 |
\item{\code{destination}}{The output destination of the \code{Appender} in human-readable form. This |
| 48 |
is mainly used when printing information about the Appender itself.} |
| 49 |
} |
| 50 |
\if{html}{\out{</div>}} |
| 51 |
} |
| 52 |
\section{Methods}{ |
| 53 |
\subsection{Public methods}{ |
| 54 |
\itemize{ |
| 55 |
\item \href{#method-Appender-new}{\code{Appender$new()}} |
| 56 |
\item \href{#method-Appender-append}{\code{Appender$append()}} |
| 57 |
\item \href{#method-Appender-set_threshold}{\code{Appender$set_threshold()}} |
| 58 |
\item \href{#method-Appender-set_layout}{\code{Appender$set_layout()}} |
| 59 |
\item \href{#method-Appender-format}{\code{Appender$format()}} |
| 60 |
} |
| 61 |
} |
| 62 |
\if{html}{\out{ |
| 63 |
<details open><summary>Inherited methods</summary> |
| 64 |
<ul> |
| 65 |
<li><span class="pkg-link" data-pkg="lgr" data-topic="Filterable" data-id="add_filter"><a href='../../lgr/html/Filterable.html#method-Filterable-add_filter'><code>lgr::Filterable$add_filter()</code></a></span></li> |
| 66 |
<li><span class="pkg-link" data-pkg="lgr" data-topic="Filterable" data-id="filter"><a href='../../lgr/html/Filterable.html#method-Filterable-filter'><code>lgr::Filterable$filter()</code></a></span></li> |
| 67 |
<li><span class="pkg-link" data-pkg="lgr" data-topic="Filterable" data-id="remove_filter"><a href='../../lgr/html/Filterable.html#method-Filterable-remove_filter'><code>lgr::Filterable$remove_filter()</code></a></span></li> |
| 68 |
<li><span class="pkg-link" data-pkg="lgr" data-topic="Filterable" data-id="set_filters"><a href='../../lgr/html/Filterable.html#method-Filterable-set_filters'><code>lgr::Filterable$set_filters()</code></a></span></li> |
| 69 |
</ul> |
| 70 |
</details> |
| 71 |
}} |
| 72 |
\if{html}{\out{<hr>}} |
| 73 |
\if{html}{\out{<a id="method-Appender-new"></a>}} |
| 74 |
\if{latex}{\out{\hypertarget{method-Appender-new}{}}} |
| 75 |
\subsection{Method \code{new()}}{ |
| 76 |
\subsection{Usage}{ |
| 77 |
\if{html}{\out{<div class="r">}}\preformatted{Appender$new(layout = Layout$new(), threshold = NA_integer_)}\if{html}{\out{</div>}} |
| 78 |
} |
| 79 |
|
| 80 |
} |
| 81 |
\if{html}{\out{<hr>}} |
| 82 |
\if{html}{\out{<a id="method-Appender-append"></a>}} |
| 83 |
\if{latex}{\out{\hypertarget{method-Appender-append}{}}} |
| 84 |
\subsection{Method \code{append()}}{ |
| 85 |
Process a \link{LogEvent} \code{event}. This method is usually not |
| 86 |
called by the user, but invoked by a \link{Logger} |
| 87 |
\subsection{Usage}{ |
| 88 |
\if{html}{\out{<div class="r">}}\preformatted{Appender$append(event)}\if{html}{\out{</div>}} |
| 89 |
} |
| 90 |
|
| 91 |
} |
| 92 |
\if{html}{\out{<hr>}} |
| 93 |
\if{html}{\out{<a id="method-Appender-set_threshold"></a>}} |
| 94 |
\if{latex}{\out{\hypertarget{method-Appender-set_threshold}{}}} |
| 95 |
\subsection{Method \code{set_threshold()}}{ |
| 96 |
Set the minimum log level that triggers this Appender. See |
| 97 |
\code{\link[=threshold]{threshold()}} for examples |
| 98 |
\subsection{Usage}{ |
| 99 |
\if{html}{\out{<div class="r">}}\preformatted{Appender$set_threshold(level)}\if{html}{\out{</div>}} |
| 100 |
} |
| 101 |
|
| 102 |
\subsection{Arguments}{ |
| 103 |
\if{html}{\out{<div class="arguments">}} |
| 104 |
\describe{ |
| 105 |
\item{\code{level}}{\code{character} or \code{integer} scalar log level. See \link{log_levels}.} |
| 106 |
} |
| 107 |
\if{html}{\out{</div>}} |
| 108 |
} |
| 109 |
} |
| 110 |
\if{html}{\out{<hr>}} |
| 111 |
\if{html}{\out{<a id="method-Appender-set_layout"></a>}} |
| 112 |
\if{latex}{\out{\hypertarget{method-Appender-set_layout}{}}} |
| 113 |
\subsection{Method \code{set_layout()}}{ |
| 114 |
Set the \code{Layout} that this Appender will use for formatting |
| 115 |
\code{LogEvents} |
| 116 |
\subsection{Usage}{ |
| 117 |
\if{html}{\out{<div class="r">}}\preformatted{Appender$set_layout(layout)}\if{html}{\out{</div>}} |
| 118 |
} |
| 119 |
|
| 120 |
} |
| 121 |
\if{html}{\out{<hr>}} |
| 122 |
\if{html}{\out{<a id="method-Appender-format"></a>}} |
| 123 |
\if{latex}{\out{\hypertarget{method-Appender-format}{}}} |
| 124 |
\subsection{Method \code{format()}}{ |
| 125 |
\subsection{Usage}{ |
| 126 |
\if{html}{\out{<div class="r">}}\preformatted{Appender$format(color = FALSE, ...)}\if{html}{\out{</div>}} |
| 127 |
} |
| 128 |
|
| 129 |
} |
| 130 |
} |