Learn R Programming

strata (version 1.4.3)

survey_log: Return the log contents of a strata log file as a tibble

Description

If users decide to pipe the results of main() or any of the logging-related functions into a log file, the contents of log file can be parsed and stored in a tibble using survey_log(). Only the messages from the log_*() functions will be parsed, all other output from the code will be ignored.

Usage

survey_log(log_path)

Value

A tibble of the contents of the log file

Arguments

log_path

Path to the log file

See Also

Other survey: survey_strata(), survey_tomls()

Other log: log_error(), log_message(), log_total_time()

Examples

Run this code
tmp <- fs::dir_create(fs::file_temp())
log <- fs::file_create(fs::path(tmp, "main.log"))
fake_log_message <- log_message("example message")
cat(fake_log_message, file = log)
survey_log(log)
fs::dir_delete(tmp)

Run the code above in your browser using DataLab