follow

fun follow(start: LogStart = LogStart.Oldest, filter: LogFilter = LogFilter()): Flow<LogEntry>(source)

The entries from start and then every new one as it is logged. The flow is cold: each collection is one stream, which ends when the collector is cancelled or the device is detached. Collect it in its own coroutine, or to wait for a line:

val settled = device.logs.follow(LogStart.Marker("checkout"), LogFilter(tags = listOf("Payments")))
.first { it.line?.message?.contains("settled") == true }

A collector that reads too slowly is ended with ServerException (RESOURCE_EXHAUSTED); follow again LogStart.After the last entry it got. A follower does not keep Device.detach waiting.