record method

void record(
  1. Iterable<LogLine> lines
)

Records lines, evicting the oldest beyond the cap.

Implementation

void record(Iterable<LogLine> lines) {
  for (final line in lines) {
    final tail = _lines.putIfAbsent(line.nodeId, () => <LogLine>[])
      ..add(line);
    if (tail.length > capacityPerNode) {
      tail.removeRange(0, tail.length - capacityPerNode);
    }
    if (!_live.isClosed) _live.add(line);
  }
}