log_view: Log view

View source: R/widget-log.R

log_viewR Documentation

Log view

Description

A scrolling log for long-running work. write() appends lines with a level ("debug", "info", "success", "warning", "error", shown in different colours). Only the last max_lines lines are kept, so memory stays bounded. While the view is scrolled to the end it follows new lines; scroll up (keys or wheel) to read older lines, or pause().

Usage

log_view(
  max_lines = 1000L,
  timestamps = FALSE,
  auto_scroll = TRUE,
  id = NULL,
  classes = NULL,
  style = NULL
)

Arguments

max_lines

Number of lines kept.

timestamps

Prefix lines with HH:MM:SS?

auto_scroll

Follow new lines?

id

Optional identifier.

classes

Optional classes.

style

A style().

Value

A LogView widget with methods write(), clear(), pause(), resume().

Examples

logs <- log_view(max_lines = 500, id = "log")
logs$write("Starting model...")
logs$write("Convergence is slow", level = "warning")

termr documentation built on Oct. 21, 2026, 5:13 p.m.