| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/log_levels.R |
| 3 |
\name{get_log_levels} |
| 4 |
\alias{get_log_levels} |
| 5 |
\alias{log_levels} |
| 6 |
\alias{log_level} |
| 7 |
\alias{add_log_levels} |
| 8 |
\alias{remove_log_levels} |
| 9 |
\title{Manage Log Levels} |
| 10 |
\usage{ |
| 11 |
get_log_levels() |
| 12 |
|
| 13 |
add_log_levels(levels) |
| 14 |
|
| 15 |
remove_log_levels(level_names) |
| 16 |
} |
| 17 |
\arguments{ |
| 18 |
\item{levels}{a named \code{character} vector (see examples)} |
| 19 |
|
| 20 |
\item{level_names}{a \code{character} vector of the names of the levels to remove} |
| 21 |
} |
| 22 |
\value{ |
| 23 |
a named \code{character} vector of the globally available log levels |
| 24 |
(\code{add_log_levels()} and \code{remove_log_levels()} return invisibly). |
| 25 |
} |
| 26 |
\description{ |
| 27 |
Display, add and remove character labels for log levels. |
| 28 |
} |
| 29 |
\section{Default Log Levels}{ |
| 30 |
|
| 31 |
|
| 32 |
lgr comes with the following predefined log levels that are identical to |
| 33 |
the log levels of log4j. |
| 34 |
|
| 35 |
\tabular{rll}{ |
| 36 |
Level \tab Name \tab Description \cr |
| 37 |
\code{0} \tab off \tab A log level of 0/off tells a Logger or Appender to suspend all logging \cr |
| 38 |
\code{100} \tab fatal \tab Critical error that leads to program abort. Should always indicate a \code{stop()} or similar \cr |
| 39 |
\code{200} \tab error \tab A severe error that does not trigger program abort\cr |
| 40 |
\code{300} \tab warn \tab A potentially harmful situation, like \code{warning()}\cr |
| 41 |
\code{400} \tab info \tab An informational message on the progress of the application\cr |
| 42 |
\code{500} \tab debug \tab Finer grained informational messages that are mostly useful for debugging\cr |
| 43 |
\code{600} \tab trace \tab An even finer grained message than debug\cr |
| 44 |
\code{NA} \tab all \tab A log level of NA/all tells a Logger or Appender to process all log events |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
\examples{ |
| 49 |
get_log_levels() |
| 50 |
add_log_levels(c(errorish = 250)) |
| 51 |
get_log_levels() |
| 52 |
remove_log_levels("errorish") |
| 53 |
get_log_levels() |
| 54 |
} |