Get or set log level threshold
log_threshold(level = NULL, namespace = "global", index = 1)see log_levels()
logger namespace
index of the logger within the namespace
currently set log level threshold
Other log configutation functions:
log_appender(),
log_formatter(),
log_layout()
## check the currently set log level threshold
log_threshold()
#> Log level: INFO
## change the log level threshold to WARN
log_threshold(WARN)
log_info(1)
log_warn(2)
#> WARN [2025-09-17 13:55:15] 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)
#> INFO [2025-09-17 13:55:15] 1
log_warn(2)
#> WARN [2025-09-17 13:55:15] 2
#> WARN [2025-09-17 13:55:15] 2
## set the log level threshold in all namespaces to ERROR
log_threshold(ERROR, namespace = log_namespaces())