flog.threshold: Get and set the threshold for a logger

Description Arguments Usage Author(s) Examples

Description

The threshold affects the visibility of a given logger. When a log statement is called, e.g. flog.debug('foo'), futile.logger compares the threshold of the logger with the level implied in the log command (in this case DEBUG). If the log level is at or higher in priority than the logger threshold, a message will print. Otherwise the command will silently return.

Arguments

threshold

integer The new threshold for the given logger

name

character The name of the logger

Usage

# Get the threshold for the given logger
flog.threshold(name) %::% character : character
flog.threshold(name=ROOT)

# Set the threshold for the given logger
flog.threshold(threshold, name=ROOT)

Author(s)

Brian Lee Yung Rowe

Examples

1
2
3
4
flog.threshold(ERROR)
flog.info("Won't print")
flog.threshold(INFO)
flog.info("Will print")

Example output

NULL
NULL
INFO [2018-12-17 02:39:19] Will print

futile.logger documentation built on May 2, 2019, 8:53 a.m.