Skip to contents

Initialize a log file with the current data and time. All major operations run after this will be logged to the specified file.

Usage

init_log(log_file)

Arguments

log_file

Path to the log file

Value

None, the function is invoked for its side effect.

See also

Examples

file_name <- "log.txt"
init_log(file_name)
#> INFO [2025-06-23 22:36:42] Starting logging
# Print the contents of the file
scan(file_name, sep = "\n", what = "character")
#> [1] "INFO [2025-06-23 22:36:42] Starting logging"