writelog: Function to write to a log file

View source: R/utils.R

writelogR Documentation

Function to write to a log file

Description

Function to write to a log file

Usage

writelog(
  content,
  logfile,
  filetype = "text",
  append = T,
  verbose = F,
  prefix = NULL,
  include.row.names = F,
  code = NULL,
  data = NULL,
  echo.code = TRUE,
  pageLength = 10
)

Arguments

content

Content to write to the logfile - text or a dataframe/tibble-like object

logfile

Path to the file where the content will be written

filetype

'txt' or 'csv' - the type of file

append

Append to existing file? or overwrite existing contents

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

writelog(df, 'logs/test.csv', filetype = 'csv', append = T)
writelog("# --- Test Log Statement --- #", 'logs/log.txt')

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