| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/Filter.R |
| 3 |
\name{FilterForceLevel} |
| 4 |
\alias{FilterForceLevel} |
| 5 |
\title{Override the log level of all events processed by a Logger/Appender} |
| 6 |
\description{ |
| 7 |
Overrides the log level of the Appender/Logger that this filter |
| 8 |
is attached to to with \code{level}. See also \code{\link[=with_log_level]{with_log_level()}}. It is |
| 9 |
recommended to use filters that modify LogEvents only with Loggers, but |
| 10 |
they will also work with Appenders. |
| 11 |
} |
| 12 |
\examples{ |
| 13 |
lg <- get_logger("test") |
| 14 |
|
| 15 |
analyse <- function(){ |
| 16 |
lg$add_filter(FilterForceLevel$new("info"), "force") |
| 17 |
on.exit(lg$remove_filter("force")) |
| 18 |
lg$error("an error with forced log level INFO") |
| 19 |
} |
| 20 |
|
| 21 |
analyse() |
| 22 |
lg$error("an normal error") |
| 23 |
lg$config(NULL) # reset config |
| 24 |
} |
| 25 |
\section{Super class}{ |
| 26 |
\code{\link[lgr:EventFilter]{lgr::EventFilter}} -> \code{FilterForceLevel} |
| 27 |
} |
| 28 |
\section{Public fields}{ |
| 29 |
\if{html}{\out{<div class="r6-fields">}} |
| 30 |
\describe{ |
| 31 |
\item{\code{level}}{an \code{integer} \link[=log_level]{log level} used to override the log |
| 32 |
levels of each \link{LogEvent} processed by this filter.} |
| 33 |
} |
| 34 |
\if{html}{\out{</div>}} |
| 35 |
} |
| 36 |
\section{Methods}{ |
| 37 |
\subsection{Public methods}{ |
| 38 |
\itemize{ |
| 39 |
\item \href{#method-FilterForceLevel-new}{\code{FilterForceLevel$new()}} |
| 40 |
\item \href{#method-FilterForceLevel-clone}{\code{FilterForceLevel$clone()}} |
| 41 |
} |
| 42 |
} |
| 43 |
\if{html}{\out{<hr>}} |
| 44 |
\if{html}{\out{<a id="method-FilterForceLevel-new"></a>}} |
| 45 |
\if{latex}{\out{\hypertarget{method-FilterForceLevel-new}{}}} |
| 46 |
\subsection{Method \code{new()}}{ |
| 47 |
Initialize a new FilterForceLevel |
| 48 |
\subsection{Usage}{ |
| 49 |
\if{html}{\out{<div class="r">}}\preformatted{FilterForceLevel$new(level)}\if{html}{\out{</div>}} |
| 50 |
} |
| 51 |
|
| 52 |
\subsection{Arguments}{ |
| 53 |
\if{html}{\out{<div class="arguments">}} |
| 54 |
\describe{ |
| 55 |
\item{\code{level}}{an \code{integer} or \code{character} \link[=log_level]{log level}} |
| 56 |
} |
| 57 |
\if{html}{\out{</div>}} |
| 58 |
} |
| 59 |
} |
| 60 |
\if{html}{\out{<hr>}} |
| 61 |
\if{html}{\out{<a id="method-FilterForceLevel-clone"></a>}} |
| 62 |
\if{latex}{\out{\hypertarget{method-FilterForceLevel-clone}{}}} |
| 63 |
\subsection{Method \code{clone()}}{ |
| 64 |
The objects of this class are cloneable with this method. |
| 65 |
\subsection{Usage}{ |
| 66 |
\if{html}{\out{<div class="r">}}\preformatted{FilterForceLevel$clone(deep = FALSE)}\if{html}{\out{</div>}} |
| 67 |
} |
| 68 |
|
| 69 |
\subsection{Arguments}{ |
| 70 |
\if{html}{\out{<div class="arguments">}} |
| 71 |
\describe{ |
| 72 |
\item{\code{deep}}{Whether to make a deep clone.} |
| 73 |
} |
| 74 |
\if{html}{\out{</div>}} |
| 75 |
} |
| 76 |
} |
| 77 |
} |