futile.logger (version 1.4.3)

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

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)

Examples

Run this code
flog.threshold(ERROR)
flog.info("Won't print")
flog.threshold(INFO)
flog.info("Will print")

Run the code above in your browser using DataLab