This function outputs (sinks) the console to a text file on disk.
Usage
logtext(
expr,
logger = get_logger(add_git_info = FALSE, init_log_file = FALSE),
silent = FALSE,
return_logger = FALSE
)Arguments
- expr
R expression(s) to output to text file
- logger
logger object from
get_logger()(default will create a new logger)- silent
(logical) whether to print file path to console after logging (default
TRUE)- return_logger
(logical) whether to return the logger object (useful if no initial logger object was passed)
Details
This function uses base::sink() to output the console
to a text file. The directory gentleman_logs/ will
be created in the logger's directory if it doesn't already exist.
If the expressions in expr fail, console output will
continue to be written to the log until sink() is manually
executed.