50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

loggit (version 2.1.1)

set_logfile: Set Log File

Description

Set the log file that loggit will write to. No logs outside of a temporary directory will be written until this is set explicitly, as per CRAN policy. Therefore, the default behavior is to create a file named loggit.log in your system's temporary directory.

Usage

set_logfile(logfile = NULL, confirm = TRUE)

Arguments

logfile

Full or relative path to log file. If not provided, will write to <tmpdir>/loggit.log.

confirm

Print confirmation of log file setting? Defaults to TRUE.

Details

A suggested use of this function would be to call it early, to log to the current working directory, as follows: set_logfile(paste0(getwd(), "/loggit.log")). 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.

Examples

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

# }

Run the code above in your browser using DataLab