Devtools
Session
A debug session around a runtime made with debug: true.
The session names the schedules it drives, keeps a bounded history of
trace events, and answers questions about it as text and data:
- run(name, { frames, until }) ticks a schedule frame by frame and stops
at the first system failure, thrown defect, or violated invariant.
- journal(filter) lists what happened, one fact per line, filtered by
frames, entity, component, resource, event, machine, system, or kind.
- why(entity, component) lists the latest changes to one component.
- system(name) shows one system's declared access and recent activity.
- describe(), dump(filter), streams() render the core debug handle.
- report() summarizes per-system timing and warnings accumulated while
tracing: missed reads, commands still pending at the end of a frame,
failed transitions, skipped systems that discarded messages, NaN or
infinite numbers written anywhere, and entity counts that keep growing
through a run.
Everything returns a Rendered value that prints as text.
Examples
const session = Session.make(runtime, {
schedules: { setup: setupSchedule, update: updateSchedule },
invariants: [PlayerInsideWorld]
})
session.run("setup")
console.log(session.run("update", { frames: 300 }))
console.log(session.why(1, Position))
console.log(session.journal({ frames: [180, 185], entity: 1 }))
No description provided yet.