Learn R Programming

logr (version 1.3.7)

log_close: Close the log

Description

The log_close function closes the log file.

Usage

log_close(footer = TRUE)

Value

None

Arguments

footer

Whether or not to print the log footer. Valid values are TRUE and FALSE. Default is TRUE.

Details

The log_close function terminates logging. The function also prints the log footer. The log footer contains a date-time stamp of when the log was closed.

See Also

log_open to open the log, and log_print for printing to the log.

Examples

Run this code
library(logr)

# Create temp file location
tmp <- file.path(tempdir(), "test.log")

# Open log
lf <- log_open(tmp)

# Send message to log
log_print("High Mileage Cars Subset")

# Perform operations
hmc <- subset(mtcars, mtcars$mpg > 20)

# Print data to log
log_print(hmc)

# Close log
log_close()

# View results
writeLines(readLines(lf))

Run the code above in your browser using DataLab