Package-level declarations

Functions

Link copied to clipboard
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".

Link copied to clipboard
suspend fun LogTapClient.awaitLogBodyContaining(timeout: Duration, substring: String): LogRecord

Convenience over awaitLog: wait for a record whose LogRecord.body contains substring. The common "did the device log this message?" assertion.

Link copied to clipboard

A short, human-readable rendering of this record for a failure dump: severity, the originating logger (if known), the body, and any remaining attributes.

Link copied to clipboard
suspend fun <T> LogTapClient.dumpingOnFailure(emit: (String) -> Unit = ::printLine, block: suspend () -> T): T

Run block; if it fails, dump the device's captured logs (via dumpLogs) before re-throwing the original failure — so a failed assertion carries the device's own logs into the test output. The block's result is returned unchanged on success.

Link copied to clipboard
suspend fun LogTapClient.dumpLogs(emit: (String) -> Unit = ::printLine)

Pull the device's captured logs and hand them to emit twice over: first as human-readable lines (via describe), then as the machine-readable NDJSON the CI harness can save as an artifact.

Link copied to clipboard

The NDJSON lines for records: each element is one LogRecord serialized to a single line of JSON, in the given order. No trailing newline is added — the sink-writing writeLogArtifact wrapper appends the line separators.

Link copied to clipboard

Decode stamped NDJSON lines back into StampedLogRecords, the inverse of stampedLogArtifactLines (parseStampedLogArtifactLines(stampedLogArtifactLines(x)) == x). Blank lines are skipped, so the trailing newline writeStampedLogArtifact emits does not decode as a phantom record.

Link copied to clipboard

Read a stamped NDJSON artifact from source: the inverse of writeStampedLogArtifact, returning the StampedLogRecords in file order. Reads to end-of-source a line at a time, so a consumer merging across devices decodes each *.ndjson back without touching StampedLogRecord.serializer directly.

Link copied to clipboard

The stamped NDJSON lines for stamped: each element is one StampedLogRecord — the log record plus its ordering stamp (producer us.tractat.kuilt.crdt.ReplicaId and cross-device total-order key) — serialized to a single line of JSON, in order.

Link copied to clipboard
fun writeLogArtifact(records: List<LogRecord>, sink: Sink)

Write records to sink as an NDJSON artifact: one JSON LogRecord per line, newline-terminated, in order. One call per booted device produces one file.

Link copied to clipboard
fun writeStampedLogArtifact(stamped: List<StampedLogRecord>, sink: Sink)

Write stamped to sink as a stamped NDJSON artifact: one JSON StampedLogRecord per line, newline-terminated, in order. The stamped counterpart of writeLogArtifact — use it when the artifact will be merged across devices (see stampedLogArtifactLines).