script_init: Initialization of the Logger for Scripts

Description Usage Arguments Author(s) Examples

View source: R/script_init.R

Description

This function initialzies the logging of the current script in a text file. The head of the logfile contains essential information on the build of the system, the R version, and the versions of the attached packages.

Usage

1
2
script_init(code_dir = ".", log_path = "logfile.txt", logger = "main",
  script_name = NULL)

Arguments

code_dir

Directory in which the script is located. Defaults to "."

log_path

Path of the logfile to be created. Defaults to "logfile.txt" within the working directory.

logger

Name of the logger handler to be initialized, defaults to "main".

script_name

(Optional) Name of the Script or project at the head of the log.

Author(s)

Sebastian Schweer

Examples

1
2
3
script_init()
logging::loginfo("This is not in logfile.txt, wrong logger")
logging::loginfo("This appears in logfile.txt", logger = 'main')

sebastianschweer/sastibe documentation built on May 29, 2019, 9:33 a.m.