closelog {luzlogr} | R Documentation |
Close current logfile
Description
Close current logfile
Usage
closelog(sessionInfo = TRUE)
Arguments
sessionInfo |
Append |
Details
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).
Value
Number of flagged messages (numeric).
Note
If the log was being written to a connection
,
closelog
will return the connection to its pre-logging state,
whether open or closed.
See Also
Examples
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)
[Package luzlogr version 0.2.1 Index]