levellog: Write messages to logs at a given priority level.

Description Usage Arguments See Also Examples

View source: R/logfuncs.R

Description

Write messages to logs at a given priority level.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Arguments

logger

An object of class 'logger'.

level

The desired priority level: a number, a character, or an object of class 'loglevel'. Will be coerced using as.loglevel.

message

A string to be printed to the log with the corresponding priority level.

See Also

loglevel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library('log4r')

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

levellog(logger, 'WARN', 'First warning from our code')
debug(logger, 'Debugging our code')
info(logger, 'Information about our code')
warn(logger, 'Another warning from our code')
error(logger, 'An error from our code')
fatal(logger, "I'm outta here")

log4r documentation built on Jan. 18, 2020, 9:06 a.m.