set.logging.functions: Sets the logging functions that shall be used by...

View source: R/set_logging_functions.R

set.logging.functionsR Documentation

Sets the logging functions that shall be used by tryCatchLog for the different severity levels

Description

The logging functions must have at least one parameter: The logging message (as character) which must be the first argument.

Usage

set.logging.functions(
  error.log.func = function(msg) tryCatchLog:::log2console("ERROR", msg),
  warn.log.func = function(msg) tryCatchLog:::log2console("WARN", msg),
  info.log.func = function(msg) tryCatchLog:::log2console("INFO", msg),
  logger.package.name = "tryCatchLog"
)

Arguments

error.log.func

The logging function for errors

warn.log.func

The logging function for warning

info.log.func

The error function for messages

logger.package.name

The logging package name of the functions (just internally used to print the name). For self-made logging functions (not part of a package) should use "custom functions" but can use any other name (it has no functionality).

Details

The default logging functions are internal functions without any dependencies to other logging packages. They use the same logging output format as futile.logger version 1.4.3.

If you want to disable any logging output you should use a decent logging framework which allows to set the logging threshold (e. g. futile.logger's flog.threshold).

The package-internal default logging functions are only a minimal implementation and are not meant to replace a decent logging framework.

To activate another logging package that is supported by tryCatchLog use set.logging.package.

Value

Nothing

See Also

tryCatchLog set.logging.package

Examples

# To disable any logging you could use "empty" functions
set.logging.functions( error.log.func = function(msg) invisible(),
                       warn.log.func  = function(msg) invisible(),
                       info.log.func  = function(msg) invisible())


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