LVRS Document Viewer
backend/DebugOutput.svx
Path: backend/DebugOutput.svx
Debug Output Schema
Location: backend/runtime/debuglogger.h, backend/runtime/debuglogger.cpp, backend/runtime/runtimeevents.h, backend/runtime/runtimeevents.cpp, backend/io/backend.h, backend/io/backend.cpp, example/VisualCatalog/qml/Main.qml, qml/components/control/util/EventListener.qml
This document defines the schema used by debug and runtime-event data that is emitted and displayed in the LVRS demo app. It is intended to let developers trace relationships between stdout logs, runtime events, and QML monitor views without ambiguity.
1. Output Channels
- Stdout text log: emitted by
LV.DebugthroughprintEntryToStdout(). - Stdout JSON log: when
LV.Debug.jsonOutput == true, an additional line is emitted as[DEBUG-ENTRY] { ... }. - Debug memory buffer: available via
LV.Debug.entries()/filteredEntries()/summary(). - RuntimeEvents buffer: available via
LV.RuntimeEvents.recentEvents(). - Backend hook buffer: available via
LV.Backend.hookedUserEvents(). - Demo Event Listener Monitor: displayed by
runtimeConsoleRowsandeventMonitorSamplesModelinexample/VisualCatalog/qml/Main.qml.
2. Current Default Output Policy (Main.qml Bootstrap)
The default values configured by Component.onCompleted and debuggerBootstrap() are:
LV.Debug.enabled = true(stdout output enabled)LV.Debug.verboseOutput = falseLV.Debug.jsonOutput = falseLV.Debug.runtimeEchoEnabled = falseLV.Debug.runtimeEchoMinIntervalMs >= 250LV.Debug.stdoutMinimumLevel = "WARN"LV.Debug.stdoutNoiseReductionEnabled = trueLV.Debug.runtimeCaptureEnabled = true
The effective behavior is warning-centric (WARN/ERROR) output with high-frequency input/lifecycle noise suppression.
3. LV.Debug Entry Schema
LV.Debug.log/warn/error and RuntimeEvents.eventRecorded are stored in the same entry buffer (m_entries).
Common Fields
source:"logger"or"runtime"level:"LOG" | "WARN" | "ERROR" | "RUNTIME"component: e.g."Main","RenderMonitor","RuntimeEvents"event: event namemessage: default UI/stdout line messagetimestampEpochMs: epoch mstimestamp:HH:MM:SS.CS(centiseconds)timestampIso: UTC ISO stringsequence: DebugLogger-local sequence (increments from 1)sessionElapsedMs: elapsed ms since debug-session startprocessIdthreadIdapplicationNameapplicationVersiondata(optional)runtimeEventSequence(when RuntimeEvents is attached)
Additional Fields for runtime Source
uptimeMsrawEvent(rawRuntimeEventsevent)
4. Stdout Output Rules
Level Priority
ERROR=3,WARN=2,RUNTIME=1,LOG=1,NONE=99- Output is emitted only if
shouldOutputLevel(entry.level) >= stdoutMinimumLevel.
Noise Filter (stdoutNoiseReductionEnabled=true)
- Blocks
created,shown,hidden,destroyedatLOGlevel - Blocks
RenderMonitor.render-statsatLOGlevel - Blocks high-frequency
RUNTIMEevents:ui-event,mouse-move,hover-move,mouse-wheel,mouse-press,mouse-release,mouse-double-clickkey-press,key-release,touch-event,tablet-event,tablet-proximity,native-gesture
Line Format
verboseOutput=false: prints onlyentry.messageverboseOutput=true:[timestamp] [level] #sequence component.event pid=... tid=... runtimeSeq=... data=...jsonOutput=true: appends[DEBUG-ENTRY] {compact-json}after the line above
5. RuntimeEvents Raw Event (eventRecorded) Schema
Common fields emitted by recordRuntimeEvent():
sequencetypetimestampEpochMsuptimeMspayload(optional)
Major type values and key payload fields:
key-press,key-release:key,keyName,modifiers,autoRepeat,text,pressedKeys,pressedKeyCodes,activeModifierNamesmouse-move,hover-move:x,y,buttons,pressedMouseButtons,modifiers,mouseButtonPressed,pointerUi,pointerObjectName,pointerClassName,pointerPathmouse-press,mouse-release,mouse-double-click: keys above +button,lastMousePressEpochMs/lastMouseReleaseEpochMs, elapsed fieldsmouse-wheel: keys above +angleDeltaX/Y,pixelDeltaX/Y,phase,invertedtouch-event:phase,pointCount,points[],pointerUitablet-event:phase,pressure,rotation,xTilt,yTilt,pointerType, etc.tablet-proximity:phasenative-gesture:gestureType,value, pointer informationcontext-requested:x,y,modifiers,buttons,reason,pointerUiui-event:eventType,objectName,className,visibledaemon-started,daemon-stopped,window-attached,window-detached,counters-reset
6. Runtime State Snapshot API Output
LV.RuntimeEvents.snapshot()
running- key/mouse/UI counters
idle,idleForMspid,rssBytes,uptimeMsdaemonBootEpochMs,eventSequence,recentEventCountlastEventinput(result ofinputState())
LV.RuntimeEvents.daemonHealth()
running,attachedWindowbootEpochMs,eventSequencerecentEventCount,recentEventCapacityidle,idleForMspidlastEventinput
LV.RuntimeEvents.inputState()
- pointer coordinates/buttons/button names/pressed state
- last press/release timestamps and elapsed durations
activePressDurationMspointerUi(hit-test result)anyKeyPressed,pressedKeys,pressedKeyCodesactiveModifiers,activeModifierNameslastKey,lastKeyText,lastKeyModifiers
7. Backend Hook Output
LV.Backend.hookUserEvents() subscribes to RuntimeEvents and keeps a separate buffer.
LV.Backend.hookedUserEvents(limit)
- list of RuntimeEvents raw events plus
hookEpochMs
LV.Backend.hookedUserEventSummary()
hookedeventCountcapacitylastEventinput(result ofcurrentUserInputState())typeCounts(aggregation by event type)runtimeEventSequence(when runtime is attached)
8. Main.qml Event Listener Monitor Output
Runtime Console Row (runtimeConsoleRows[]) Schema
category:runtime|input|ui|render|navigation|systemsourcetypesequencetimestampEpochMsuptimeMspayloadsummary(type-specific summary string)detail(abbreviated payload string)
Display timestamps follow runtimeConsoleTimestamp() in HH:MM:SS.mmm format.
Category mapping follows runtimeConsoleCategoryForType():
- Input family:
key-*,mouse-*,touch-*,tablet-*,native-gesture*,hover-*,context-*,global-*->input ui-event->uirender-*->renderroute-*,viewstack-*->navigationdaemon-*,window-*,catalog-*,counters-*->runtime- Others ->
system
EventListener Sample (eventMonitorSamplesModel) Schema
triggersourcetimestampEpochMspayload
If samples exceed eventMonitorMaxSamples, oldest entries are removed first (FIFO).
9. EventListener Callback Payload Schema
Based on qml/components/control/util/EventListener.qml:
- Local pointer triggers (
clicked|pressed|released):x,y,globalX,globalY,button,buttons,modifiers,isGlobal=falseui(optional,includeUiHit=true)input(optional,includeInputState=true)backend(optional,includeBackendSummary=true)
- Global triggers (
globalPressed|globalContextRequested):x,y,globalX,globalY,buttons,modifiers,isGlobal=trueui(optional,includeUiHit=true)input(optional,includeInputState=true)backend(optional)- for context events,
reasonandsource(mouse|context)are added
- Key/wheel triggers pass Qt event objects directly.
Deduplication:
- Global-press deduplication:
globalPressDedupMs(default 24ms), coordinate toleranceglobalPressDedupTolerancePx(default 2px) - Context deduplication:
contextDedupMs(default 180ms), coordinate tolerancecontextDedupTolerancePx(default 2px)
10. Render-Performance Alert Output Conditions
evaluateRenderPerformance() runs periodically and emits through LV.Debug.
- Severe:
lastFrameMs >= 50orfps < 18->ERROR render-performance-severe(minimum interval: 1600ms) - Degraded:
lastFrameMs >= 33orfps < 30->WARN render-performance-degraded(minimum interval: 2000ms) - Recovery:
WARN render-performance-recoveredafter normal state is maintained for 3 seconds
Common payload:
fpslastFrameMsframeCountbackend(LV.RenderQuality.graphicsBackend)
Consumer Implementation Notes
When integrating with log viewers or telemetry pipelines:
- treat
sequenceas ordered-event cursor, - treat
timestampfields as wall-clock and compute latency externally, - avoid strict schema parsing on optional payload fields for forward compatibility.
Parser Safety Recommendations
- always null-check nested maps (
payload,input,ui), - tolerate missing keys for older entries,
- keep unknown field passthrough to preserve future extensibility.