log_write | R Documentation |
log_write()
gets and formats the content of the log.rx before writing it
to a log file
log_write(
file = NA,
remove_log_object = TRUE,
show_repo_url = FALSE,
include_rds = FALSE,
to_report = c("messages", "output", "result")
)
file |
String. Path to file executed |
remove_log_object |
Boolean. Should the log object be removed after writing the log file? Defaults to TRUE |
show_repo_url |
Boolean. Should the repo URLs be reported Defaults to FALSE |
include_rds |
Boolean. Option to export log object as Rds file. Defaults to FALSE |
to_report |
String vector. Objects to optionally report; additional
information in |
Nothing
dir <- tempdir()
text <- 'print("Hello, Timberperson!")'
fileConn <- file(file.path(dir, "hello.R"))
writeLines(text, fileConn)
close(fileConn)
file <- file.path(dir, "hello.R")
# Initialise and configure the log.rx environment
log_config(file)
# Run the script and record results, outputs, messages, errors, and warnings
logrx:::run_safely_loudly(file)
# Write the log
log_write(file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.