recordEvent static method
Buffer r and emit it on onEventRecord, with its payload made
JSON-safe and run through the registered TelescopeRedaction.redactor
(if any) first; dropped when the redactor throws. See
TelescopeRedaction.redactEventRecord.
Implementation
static void recordEvent(EventRecord r) {
if (_paused) return;
final EventRecord? redacted = TelescopeRedaction.redactEventRecord(r);
if (redacted == null) return;
_events.addLast(redacted);
while (_events.length > _capacityOf(TelescopeKind.events)) {
_events.removeFirst();
}
_eventStream.add(redacted);
}