awaitLog

suspend fun LogTapClient.awaitLog(timeout: Duration, predicate: (LogRecord) -> Boolean): LogRecord

Wait for the device to log something you care about, then carry on — the test-side equivalent of "tail the logs until I see the line I expect".

Live-tails the tapped device and returns the first LogRecord for which predicate is true. If no matching record arrives within timeout, it fails with a message that lists what did arrive — so a CI failure tells you which logs the device produced instead of the one you were waiting for, not just "timed out".

Deterministic under a test dispatcher: the timeout is virtual-time aware, so the wait neither hangs nor sleeps in wall-clock time.

Parameters

timeout

the upper bound on the wait. A bounded wait by construction — there is no unbounded form.

predicate

the match condition over each replicated LogRecord.

Throws

if no record matches within timeout.