set_logfile: Set Log File

Description Usage Arguments Details Examples

View source: R/configurations.R

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

1
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

1
set_logfile(file.path(tempdir(), "loggit.log"))

loggit documentation built on Feb. 28, 2021, 9:06 a.m.