powered by
Useful for e.g. read and write operations on databases etc. that are not automatically captured.
log_read(file, log = Sys.getenv("WHIRL_LOG_MSG"))log_write(file, log = Sys.getenv("WHIRL_LOG_MSG"))log_delete(file, log = Sys.getenv("WHIRL_LOG_MSG"))
log_write(file, log = Sys.getenv("WHIRL_LOG_MSG"))
log_delete(file, log = Sys.getenv("WHIRL_LOG_MSG"))
character() description of the file that was read, written or deleted.
character()
character() path to the log file.
The default environment variable WHIRL_LOG_MSG is set in the session used to log scripts, and input is automatically captured in the resulting log.
WHIRL_LOG_MSG
If run outside of whirl, meaning when the above environment variable is unset, the operations are streamed to stdout(). By default the console.
stdout()
# Stream logs to console since `WHIRL_LOG_MSG` is not set: log_read("my/folder/input.txt") log_write("my/folder/output.txt") log_delete("my/folder/old_output.txt")
Run the code above in your browser using DataLab