level: Set the logging threshold level for a logger dynamically

View source: R/level.R

levelR Documentation

Set the logging threshold level for a logger dynamically

Description

It can sometimes be useful to change the logging threshold level at runtime. The level() accessor allows doing so.

Usage

level(x)

level(x) <- value

## S3 method for class 'logger'
level(x)

## S3 replacement method for class 'logger'
level(x) <- value

available.loglevels()

Arguments

x

An object of class "logger".

value

One of "DEBUG", "INFO", "WARN", "ERROR", or "FATAL".

Examples

lgr <- logger()
level(lgr) # Prints "INFO".
info(lgr, "This message is shown.")
level(lgr) <- "FATAL"
info(lgr, "This message is now suppressed.")

johnmyleswhite/log4r documentation built on Oct. 22, 2024, 8 p.m.