Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 947 Bytes

FsmTrace.md

File metadata and controls

36 lines (24 loc) · 947 Bytes

FsmTrace

Console trace adapter for the Fsm module. Provides a ready-made TraceProc that prints one line per Step to stdout via InOut.

Why FsmTrace?

The Fsm module accepts an optional trace callback but does not include any output logic itself. FsmTrace fills that gap for development and debugging without requiring m2Log or any other dependency.

Procedures

ConsoleTrace

PROCEDURE ConsoleTrace(traceCtx: ADDRESS;
                       fromState, toState: StateId;
                       ev: EventId; action: ActionId;
                       status: StepStatus);

Print a human-readable trace line to stdout. Compatible with the Fsm.TraceProc type signature.

Output format:

FSM: <from> -> <to> ev=<event> act=<action> <STATUS>

Where <STATUS> is one of OK, NO_TRANS, REJECTED, or ERROR.

Usage

FROM FsmTrace IMPORT ConsoleTrace;
...
Fsm.SetTrace(f, ConsoleTrace, NIL);