closelog | R Documentation |
Close current logfile
closelog(sessionInfo = TRUE)
sessionInfo |
Append |
Close current logfile. The number of flagged messages is returned,
invisibly. Note that if options(luzlogr.close_on_error = TRUE)
is set, then
if an error occurs, all log files will be automatically closed. This behavior
is not currently enabled by default.
Logs are stored on a stack, and so when one is closed, logging output returns to the previous log (if any).
Number of flagged messages (numeric).
If the log was being written to a connection
,
closelog
will return the connection to its pre-logging state,
whether open or closed.
openlog
printlog
logfile1 <- openlog("A.log")
printlog("message to A", flag = TRUE)
logfile2 <- openlog("B.log")
printlog("message to B")
flagcountB <- closelog()
flagcountA <- closelog(sessionInfo = FALSE)
file.remove(logfile1, logfile2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.