log_enable: log_enable

Description Usage Arguments Value Examples

View source: R/log_enable.R

Description

Assigns the necessary global scope objects for logging with "log4r".

Usage

1
2
3
4
5
6
log_enable(
  logfile_loc = NULL,
  pos = 1,
  logger_nm = my_logger,
  appender_nm = file_app
)

Arguments

logfile_loc

The path to the logfile. Suggested use "logs/logfile.txt".

pos

The environment which to assign pipeline_message. Defaults to 1, equivalent to the .GlobalEnv.

logger_nm

What to call the logger. Provide unquoted strings with no spaces. Defaults to my_logger.

appender_nm

What to call the appender function. Provide unquoted strings with no spaces. Defaults to file_app.

Value

Creates logger and file appender.

Examples

1
2
3
4
5
6
7
# create logging infrastructure
log_file_ops(dir_path = "logs/logfile.txt")
# enable logging
log_enable(logfile_loc = "logs/logfile.txt")

# tidy up environment
unlink("logs", recursive = TRUE)

ptspotter documentation built on May 3, 2021, 9:07 a.m.