set.logging.package: Enables one of the supported logging package used by...

View source: R/set_logging_package.R

set.logging.packageR Documentation

Enables one of the supported logging package used by tryCatchLog to write log output

Description

If this optional argument is omitted, either the package name from the option tryCatchLog.preferred.logging.package is enabled or all supported logging packages (see the vector of default values) are probed in this order and the first existing (= installed) logging package is enabled.

Usage

set.logging.package(
  logging.package.name = getOption("tryCatchLog.preferred.logging.package",
    c("futile.logger", "lgr", "tryCatchLog"))
)

Arguments

logging.package.name

The name of the logging package (character) that shall be enabled.

Details

If the passed logging framework(s) is/are not installed the internal logging functions of tryCatchLog will be enabled as fall-back.

To enable a non-supported logging framework you can call set.logging.functions instead.

To configure a standard logging package when tryCatchLog is loaded and set.logging.package is called without an argument you can use the option tryCatchLog.preferred.logging.package. You could also set a vector of packages to "probe" (the first installed package of the list is taken, in none is installed tryCatchLog-internal logging is used.

Value

The name of the enabled logging framework

See Also

set.logging.functions

Examples

tryCatchLog:::set.logging.package("futile.logger")
tryCatchLog:::set.logging.package("lgr")
tryCatchLog:::set.logging.package("tryCatchLog")

# takes the first installed logging package from the list of supported packages
tryCatchLog:::set.logging.package()

# only considered when tryCatchLog is loaded or set.logging.package() is called!
# takes the logging package fromt the configured option (if installed, else tryCatchLog)
options(tryCatchLog.preferred.logging.package = "futile.logger")
tryCatchLog:::set.logging.package()

aryoda/tryCatchLog documentation built on Feb. 6, 2023, 1:42 a.m.