Learn R Programming

logr (version 1.3.7)

log_resume: Resume writing to a log

Description

A function to reopen and resume writing to a log file that has been suspended.

Usage

log_resume(file_name = NULL)

Value

The path of the log.

Arguments

file_name

The name of the log file to resume. If the file_name parameter is not supplied, the function will look in the current session for the original name and path of the log. If that name and path is not found, an error will be generated.

See Also

log_suspend for suspending the log, and log_close to close 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("Before suspend")

# Suspend log
log_suspend()

# View suspended log
writeLines(readLines(lf))

# Resume log
log_resume(lf)

# Print data to log
log_print("After suspend")

# Close log
log_close()

# View results
writeLines(readLines(lf))

Run the code above in your browser using DataLab