start_logging: Start Logging

Description Usage Arguments Details See Also Examples

Description

Initialises the logging to the console and optionally a file.

Usage

1
start_logging(level = "INFO", file = NULL, logger = "", reset = TRUE)

Arguments

level

The logging level of the root logger. Defaults to "INFO".

file

Optional file name or path for logging to a file. Defaults to NULL.

logger

Character string indicating the logger for the handler. Defaults to the root logger.

reset

Boolean value indicating whether to reset the logging to the basicConfig.

Details

Starts logging by loading the logging package, resetting the logging (reset = TRUE, the default). Then it sets up a handler to log to the console, and if a file has been specified it sets up a handler to log to the file. Finally a message is logged at the INFO level to indicate that the logging has been started.

See Also

logging a tentative logging package

Examples

1
2
3
4
5
start_logging()
start_logging(file = 'log.txt')
start_logging(  level = 'CRITICAL'
              , logger = 'my_logger'
              , reset = FALSE)

erikjandevries/r.dstools.ej documentation built on May 24, 2019, 4:02 a.m.