event static method
void
event(})
Writes a structured trace event payload.
The output line format is stable and machine-parseable:
"[+123us] [input] @event {\"v\":1,\"type\":\"...\",...}".
Implementation
static void event(
String type, {
TraceTag tag = TraceTag.general,
Map<String, Object?> fields = const <String, Object?>{},
}) {
if (!enabled || !isTagEnabled(tag)) return;
if (type.trim().isEmpty) return;
final payload = <String, Object?>{
'v': _eventSchemaVersion,
'type': type,
...fields,
};
_writeRaw('[${tag.name}] $_eventMarker${jsonEncode(payload)}');
}