1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/logger.R
\name{log_threshold}
\alias{log_threshold}
\title{Get or set log level threshold}
\usage{
log_threshold(level = NULL, namespace = "global", index = 1)
}
\arguments{
\item{level}{see \code{\link[=log_levels]{log_levels()}}}
\item{namespace}{logger namespace}
\item{index}{index of the logger within the namespace}
}
\value{
currently set log level threshold
}
\description{
Get or set log level threshold
}
\examples{
\dontshow{old <- logger:::namespaces_set()}
## check the currently set log level threshold
log_threshold()
## change the log level threshold to WARN
log_threshold(WARN)
log_info(1)
log_warn(2)
## add another logger with a lower log level threshold and check the number of logged messages
log_threshold(INFO, index = 2)
log_info(1)
log_warn(2)
## set the log level threshold in all namespaces to ERROR
log_threshold(ERROR, namespace = log_namespaces())
\dontshow{logger:::namespaces_set(old)}
}
\seealso{
Other log configutation functions:
\code{\link{log_appender}()},
\code{\link{log_formatter}()},
\code{\link{log_layout}()}
}
\concept{log configutation functions}
|