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)
Run the code above in your browser using DataLab