closelog: Close current logfile

Description Usage Arguments Details Value Note See Also Examples

Description

Close current logfile

Usage

1

Arguments

sessionInfo

Append sessionInfo output? (logical, optional)

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

openlog printlog

Examples

1
2
3
4
5
6
logfile <- openlog("A.log")
printlog("message to A", flag = TRUE)
logfile <- openlog("B.log")
printlog("message to B")
flagcountB <- closelog()
flagcountA <- closelog(sessionInfo = FALSE)

bpbond/luzlogr documentation built on May 13, 2019, 1:42 a.m.