write method
Consumes event. Must not throw. May be asynchronous internally.
Implementation
@override
void write(LogEvent event) {
if (_closed) return;
final line = formatter.format(event);
_tail = _tail.then((_) async {
try {
await _ensureOpen();
if (_bytesWritten >= maxBytes) {
await rotate();
await _ensureOpen();
}
_out?.writeln(line);
_bytesWritten += line.length + 1;
} catch (_) {
// Swallowed.
}
});
}