Learn R Programming

log4r (version 0.4.4)

level: 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 logger level(x)

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

Arguments

x

An object of class logger.

value

A loglevel.

See Also

loglevel()

Examples

Run this code

library('log4r')

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

Run the code above in your browser using DataLab