flush method

  1. @override
Future<void> flush({
  1. Duration timeout = const Duration(seconds: 2),
})
override

Flushes any pending buffered events to the underlying transport. Returns a future that completes when all buffered events have been written, or when timeout elapses, whichever is first.

Implementation

@override
Future<void> flush({Duration timeout = const Duration(seconds: 2)}) async {
  try {
    await _tail.timeout(timeout, onTimeout: () {});
    await _ensureOpen();
    await _out?.flush().timeout(timeout, onTimeout: () {});
  } catch (_) {
    // Swallowed.
  }
}