init.log: Function to write to a log file

View source: R/utils.R

init.logR Documentation

Function to write to a log file

Description

Function to write to a log file

Usage

init.log(
  logfile,
  base.func.name,
  type = "text",
  current.time = Sys.time(),
  is.base.func = T,
  verbose = F,
  title = "Log",
  libraries = c("rmarkdown")
)

Arguments

logfile

Path to the file where the content will be written

base.func.name

the function name where the call originated - to be written at the top of the log file

current.time

time the function got called

is.base.func

log file shouldnt get initialized if the function gets called within a function that is not the originating one Just tells us whether to actually create the log file or not

verbose

This is what it will be called in parent functions - verbose tells whether to actually write to the logfile or not This will allow us to write the code in the other functions and files without a bunch of if statements .

Examples

init.log(logfile, sys.call())

SCCWRP/SQOUnified documentation built on Nov. 3, 2024, 12:54 a.m.