Learn R Programming

loggit (version 1.2.0)

get_logs: Return Log File as an R Object

Description

This function returns a data.frame (by default) containing all the logs in the provided JSON log file. If no explicit log fie is provided, calling this function will return a data frame of the log file currently pointed to by the loggit functions. Users can request that the logs be returned as a list, though this is not recommended.

Usage

get_logs(logfile, as_df = TRUE)

Arguments

logfile

JSON-format log file to return.

as_df

Should logfile be returned in a data.frame vs. a list? Defaults to TRUE, and will return a data.frame.

Value

A data.frame.

Examples

Run this code
# NOT RUN {
agree_to_upcoming_loggit_updates()
setLogFile(file.path(tempdir(), "loggit.json"), confirm = FALSE)
message("Test log message")
get_logs(getLogFile())

# }

Run the code above in your browser using DataLab