set_logfile {loggit}R Documentation

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

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


[Package loggit version 2.1.1 Index]