openlog: Open a new logfile

Description Usage Arguments Details Value See Also Examples

Description

Open a new logfile

Usage

1
2
openlog(scriptname, loglevel = -Inf, logfile = NULL, append = FALSE,
  sink = TRUE)

Arguments

scriptname

Name of script (and thus logfile)

loglevel

Minimum priority level (numeric, optional)

logfile

Override default logfile (character or connection, optional)

append

Append to logfile? (logical, optional)

sink

Send all console output to logfile? (logical, optional)

Details

Open a new logfile. If sink is TRUE (the default), all screen output will be captured (via sink). Re-opening a logfile will erase the previous output unless append is TRUE. Note that messages will only appear in the logfile if their level exceeds loglevel; this allows you to easily change the amount of detail being logged.

Value

Invisible fully-qualified name of log file

See Also

printlog closelog

Examples

1
2
3
4
5
logfile <- openlog("test")
printlog("message")
print("This will also appear in the logfile, as sink is TRUE")
closelog()
readLines(logfile)

JGCRI/JGCRIutils documentation built on May 7, 2019, 7:43 a.m.