.old_wd <- setwd(tempdir())
# create logging infrastructure
log_file_ops(dir_path = "logs/logfile.txt")
# enable logging
log_enable(logfile_loc = "logs/logfile.txt")
# tidy up environment
unlink("logs", recursive = TRUE)
setwd(.old_wd)
Run the code above in your browser using DataLab