Engine Report Log And Recovery Routing
Purpose
The engine report log is the shared editor/runtime stream for recoverable failures and operator-facing diagnostics. Use it when a system needs to report a problem with severity, source ownership, recovery command, deep link, and validation target instead of emitting an unstructured log line.
Steps
- Choose an
EngineReportSourcethat owns the diagnostic surface. - Prefer a typed
EngineReportCodewhen the failure has stable recovery and validation metadata. - Create a
PendingEngineReportwith info, warning, or error severity. - Send it through the pending-report events handled by
src/editor/runtime/reports.rs. - Read recent entries through
EngineReportLog, or project them into a shared validation report for diagnostics surfaces.
Expected Outputs
Entries are stored newest-first with a bounded history. A typed code supplies default severity, recovery command, deep link, validation target, and source. The shared validation projection turns error entries into blocking validation issues and keeps info or warning entries non-blocking.
Common Mistakes
Common mistakes include using raw logs for actionable editor failures, adding a new source without fallback recovery metadata, emitting repeated reports every frame, using error severity for informational slow-frame notes, or forgetting that newest entries are pushed to the front of the log.
Recovery Paths
If a report does not appear, confirm that the active app mode includes the shared engine-report plugin and that the event is sent on the expected pending-report path. If the report appears without a useful button or route, add or fix the typed code descriptor. If validation severity is wrong, check the entry severity before changing validation consumers.