sink_all: Divert Message And Output Stream to File

View source: R/sink_all.R

sink_allR Documentation

Divert Message And Output Stream to File

Description

All output and messages up to the first error, for example thrown by stop.

Usage

sink_all(path, code)

Arguments

path

The path of the file to divert to.

code

The code to be executed.

Value

Invisibly NULL.

Examples

sink_path  <- file.path(tempdir(), "sink_all.txt")
sink_all(sink_path, {
         print("some output")
         warning("a warning")
         message("a message")
         print("some more output")
})
cat(readLines(sink_path), sep = "\n")

fakemake documentation built on Aug. 16, 2023, 1:09 a.m.