recentFor method

List<LogLine> recentFor(
  1. String nodeId, {
  2. int tail = 200,
})

The last tail lines from nodeId, oldest first — the order a log is read in.

Implementation

List<LogLine> recentFor(String nodeId, {int tail = 200}) {
  final lines = _lines[nodeId] ?? const <LogLine>[];
  if (lines.length <= tail) return List.of(lines);
  return lines.sublist(lines.length - tail);
}