Learn R Programming

loggit (version 1.2.0)

setLogFile: Set Log File

Description

Set the log file that loggit will write to. No logs will be written until this is set, as per CRAN policy. The suggested use of this function would be to call it early, to log to the current working directory, as follows: setLogFile(paste0(getwd(), "/loggit.json")). If you are using loggit in your package, you can wrap this function in .onLoad() so that the logfile is set when your package loads.

Usage

setLogFile(logfile = NULL, confirm = TRUE)

Arguments

logfile

Full path to log file. Until other output formats are introduced, the file name must end in ".json".

confirm

Print confirmation of log file setting? Defaults to TRUE.

Examples

Run this code
# NOT RUN {
setLogFile(file.path(tempdir(), "loggit.json"))

# }

Run the code above in your browser using DataLab