log_config()
initialises the log.rx environment, adds its attributes, and
sets them
log_config(file = NA, log_name = NA, log_path = NA, extra_info = NA)
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)
#> [1] "Hello, Timberperson!"
# Write the log
log_write(file)