What it does
logs
Log viewer tab for the System Tools inspector. Colour-codes levels,
filters by level and by type, truncates long messages with a
click-to-expand collapsible, and refreshes at 5 Hz from the engine log
ring buffer via queryLogsTable(). Loaded by system_tools.module.
Exports
M.build(_state) -> any— build the zui widget tree for the tab.M.onCallback(callbackId: string, data: any, _state: any) -> boolean— handle widget callbacks (filter toggles, type dropdown, clear).M.label: string— tab title shown in the inspector.M.refresh: number— refresh cadence in seconds (0.2= 5 Hz).
Types:
LogEntry = { level?: string, type?: string, message?: string }— shape of an entry returned byqueryLogsTable().
Usage
local Logs = require("@builtin::modules.engine.editor.system_tools.tabs.logs")
local widget = Logs.build(state)
Logs.onCallback("logs-clear", nil, state)
Notes
- Filter state (level toggles, type filter) lives in module locals and
persists across rebuilds. Filters do NOT trigger the host dirty flag
on their own —
onCallbackis responsible for returningtrueto request a rebuild. clearLogsBufferis a global injected by the engine; the Clear button calls it viapcalland invalidates the snapshot cache.- Visible row cap is 200; the oldest entries are dropped from the rendered list (not the ring buffer).
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.