These functions provide a simple interface to the root logger. If you do not
need any of the more advanced features of lgr, start here.
lgr provides convenience functions to manage the root Logger. These
are intended for interactive use, and for people who just need basic
logging facilities and don't want to worry about hierarchical loggers and
R6 classes.
threshold() sets or retrieves the threshold for an Appender or Logger
(the minimum level of log messages it processes). It's target defaults
to the root logger.
console_threshold() is a shortcut to set the threshold of the root
loggers AppenderConsole, which is usually the only Appender that manages
console output for a given R session.
add_appender() and remove_appender() add Appenders to Loggers and
other Appenders.
show_log() displays the last n log entries of target if target is
an Appender with a show() method or a Logger with at least one such
Appender attached. target defaults to the root logger, which has an
AppenderDt attached by default if the package data.table is installed.
With the default logging settings this includes also TRACE and DEBUG
messages, even if they were not printed to the console before.
show_data() and show_dt() work similar to show_log(), except that
they return the log as data.frame or data.table respectively.