Skip to contents

Returns everything a logtree_sink_memory() sink has collected so far, as a data frame with one row per event and the same columns a "json" file sink writes (see logtree_sink_file()), so the two views of a run agree:

Usage

logtree_sink_memory_events(id)

Arguments

id

A memory sink's id, as returned by logtree_sink_memory().

Value

A data frame with one row per collected event, oldest first, and zero rows (with the columns above) when nothing has been logged yet.

Details

ColumnWhat it holds
tswhen the event was emitted (POSIXct)
levelevent kind: "open", "close", "group", "group_close", "leaf"
id, parent_id, depththe node's identity and place in the tree
labela step's label, a group's name, or a leaf's message
elapsedseconds, on close lines only; NA elsewhere
statusa leaf's status, "step"/"group" on an opening line, or the resolved status on a close
fn, file, linethe call site, when the trace theme slot recorded one; NA otherwise

Examples

logtree_reset()
h <- logtree_sink_memory()
f <- function() log_info("Reading config.yml")
invisible(f())
#>  Reading config.yml
logtree_sink_memory_events(h)
#>                    ts                      run_id level id parent_id depth
#> 1 2026-08-11 14:28:54 20260811T142854.882-6905-20  leaf  1         0     0
#>                label elapsed status fn file line
#> 1 Reading config.yml      NA   info  f <NA>   NA
logtree_sink_remove(h)