printlog: Time-stamped output function

Description Usage Arguments Details Value See Also Examples

Description

Time-stamped output function

Usage

1
printlog(msg = "", ..., level = 0, ts = TRUE, cr = TRUE)

Arguments

msg

A message to log (optional)

...

Additional items to log (optional)

level

Priority level (numeric, optional)

ts

Print preceding timestamp? (logical, optional)

cr

Print trailing newline? (logical, optional)

Details

Logs a message, which may consist of one or more printable objects

Value

Invisible success (TRUE) or failure (FALSE)

See Also

openlog closelog

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
logfile <- openlog("test")
printlog("message")
printlog(1, "plus", 1, "equals", 3)
closelog()
readLines(logfile)

logfile <- openlog("test", loglevel = 1)
printlog("This message will not appear", level = 0)
printlog("This message will appear", level = 1)
closelog(sessionInfo = FALSE)
readLines(logfile)

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