add method
Add a log message with an optional timestamp.
If the buffer is at capacity the oldest entry is evicted.
Implementation
void add(String message, {DateTime? timestamp}) {
if (_entries.length >= capacity) {
_entries.removeFirst();
}
_entries.addLast(
LogEntry(message: message, timestamp: timestamp ?? DateTime.now()),
);
}