R/logs.R

Defines functions log_text

# Prep the contents of a stdout or stderr log for
# renderText() and textOutput().
log_text <- function(path, tail_only) {
  if (!(length(path) && file.exists(path))) return()
  out <- readLines(path, warn = FALSE)
  if (tail_only) out <- tail(out, n = 25)
  paste0(out, collapse = "\n")
}
wlandau/targets-shiny documentation built on July 4, 2025, 4:25 p.m.