flush method

  1. @override
Future<void> flush()
override

Completes when every log event queued before this call has been processed.

Concurrent calls are serialized: a later flush first waits for the earlier one and then drains the events queued in between. Note that the internal queue listener is re-created in the zone of this call, so subsequent zone-reported handler errors go to that zone.

Implementation

@override
Future<void> flush() {
  if (isClosed) {
    return Future<void>.value();
  }

  final previous = _flushFuture;
  return _flushFuture = _flush(previous);
}