openlog: Open a new logfile

Description Usage Arguments Details Value See Also Examples

Description

Open a new logfile

Usage

1
openlog(file, loglevel = -Inf, append = FALSE, sink = FALSE)

Arguments

file

Name of logfile (character or writeable connection)

loglevel

Minimum priority level (numeric, optional)

append

Append to logfile? (logical, optional)

sink

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

Details

Open a new logfile. Messages will only appear in the logfile if their level exceeds the log's loglevel; this allows you to easily change the amount of detail being logged.

Re-opening a logfile will erase the previous output unless append is TRUE. Opening a new logfile when one is already open will temporarily switch logging to that new file.

If sink is TRUE, all screen output will be captured (via sink).

Value

Invisible fully-qualified name of log file.

See Also

printlog closelog

Examples

1
2
3
4
logfile <- openlog("test.log")
printlog("message")
closelog()
readLines(logfile)


Search within the luzlogr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.