$ rezi
Widgets

LogsConsole

Scrollable log viewer for debug panels and tooling.

Scrollable log viewer for debug panels and tooling.

Usage

ui.logsConsole({
  id: "logs",
  entries: state.logs,
  autoScroll: true,
  levelFilter: ["info", "warn", "error"],
  scrollTop: state.logsScrollTop,
  showTimestamps: true,
  onScroll: (top) => app.update((s) => ({ ...s, logsScrollTop: top })),
  onClear: () => app.update((s) => ({ ...s, logs: [] })),
})

Props

PropTypeDefaultDescription
idstringrequiredWidget identifier
entriesLogEntry[]requiredLog entries to render
autoScrollboolean-Auto-scroll to newest entry
levelFilterLogLevel[]-Filter by severity
sourceFilterstring[]-Filter by source/category
searchQuerystring-Text filter
scrollTopnumberrequiredScroll offset (entries)
showTimestampsbooleantrueShow timestamps
showSourcebooleantrueShow source labels
expandedEntriesstring[]-Expanded entry IDs
onScroll(scrollTop) => voidrequiredScroll callback
onEntryToggle(id, expanded) => void-Expand/collapse callback
onClear() => void-Clear entries callback

Mouse Behavior

  • Mouse scroll wheel scrolls log entries, firing the onScroll callback.
  • Clicking the console area focuses the widget.

Notes

  • LogEntry supports optional details, token usage, duration, and cost fields.
  • LogLevel values: "trace", "debug", "info", "warn", "error".
  • Helper functions like applyFilters and computeAutoScrollPosition are exported from @rezi-ui/core for app-level logic.

On this page