logger (version 0.3.0)

log_threshold: Get or set log level threshold

Description

Get or set log level threshold

Usage

log_threshold(level = NULL, namespace = "global", index = 1)

Value

currently set log level threshold

Arguments

level

see log_levels

namespace

logger namespace

index

index of the logger within the namespace

See Also

logger, log_layout, log_formatter, log_appender

Examples

Run this code
if (FALSE) {
## check the currently set log level threshold
log_threshold()

## change the log level threshold to WARN
log_threshold(WARN)
log_info(1)
log_warn(2)

## add another logger with a lower log level threshold and check the number of logged messages
log_threshold(INFO, index = 2)
log_info(1)
log_warn(2)

## set the log level threshold in all namespaces to ERROR
log_threshold(ERROR, namespace =  log_namespaces())
}

Run the code above in your browser using DataLab