Learn R Programming

loggit2 (version 2.3.1)

set_logfile: Set Log File

Description

Set the log file that loggit will write to by default.

Usage

set_logfile(logfile = NULL, confirm = TRUE, create = TRUE)

Value

Invisible the previous log file path.

Arguments

logfile

Absolut or relative path to log file. An attempt is made to convert the path into a canonical absolute form using normalizePath(). If NULL will set to <tmpdir>/loggit.log.

confirm

Print confirmation of log file setting?

create

Create the log file if it does not exist?

Details

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.

Examples

Run this code
if (FALSE) {
  set_logfile("path/to/logfile.log")
}

Run the code above in your browser using DataLab