level: Set or get the priority level for a logger object.

levelR Documentation

Set or get the priority level for a logger object.

Description

The priority level can be an integer from the set 1..5 (otherwise it will be modified sensibly to fit in that range), or a named logging level (one of "DEBUG", "INFO", "WARN", "ERROR", or "FATAL"). An object of class loglevel is also accepted; other input will be coerced using as.loglevel().

Usage

level(x)

level(x) <- value

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

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

Arguments

x

An object of class logger.

value

A loglevel.

See Also

loglevel()

Examples


library('log4r')

logger <- create.logger(logfile = 'debugging.log', level = 1)
level(logger)
level(logger) <- "FATAL"

log4r documentation built on Oct. 12, 2024, 9:06 a.m.