LogTapClient

class LogTapClient(seam: Seam, parentScope: CoroutineScope, config: LogTapConfig = LogTapConfig(), admission: LogTapAdmission = LogTapAdmission.Open) : ScopedCloseable

The test/harness side of a log tap: join a device and read its logs out.

Given a Seam already woven onto the device's session (the harness joins the same us.tractat.kuilt.core.Loom the device hosts on), a client either takes a one-shot pull of everything captured so far or tails the logs live as they arrive. The underlying replication is order-preserving and de-duplicating, so the reconstructed sequence matches the device's, with no repeats — even across a reconnect.

Close the client to release its replicator.

Constructors

Link copied to clipboard
constructor(seam: Seam, parentScope: CoroutineScope, config: LogTapConfig = LogTapConfig(), admission: LogTapAdmission = LogTapAdmission.Open)

Functions

Link copied to clipboard
override fun close()
Link copied to clipboard
suspend fun pull(): List<LogRecord>

Pull a snapshot of the device's logs: wait for the host's logs to replicate in, then return everything captured so far in the device's order, with no duplicates.

Link copied to clipboard

Like pull, but each record carries its ordering StampedLogRecord.rgaId — the producer identity and cross-device total-order key needed to merge several devices' logs into one timeline. Same convergence and timeout semantics as pull; the only difference is that the RGA's per-element ids are surfaced rather than discarded.

Link copied to clipboard
fun tail(): Flow<LogRecord>

Tail the device's logs live: emits each LogRecord as it replicates in, in order and exactly once. The flow replays everything already known on collection, then continues with newly captured records until the collector is cancelled.

Link copied to clipboard

Like tail, but each streamed record carries its ordering StampedLogRecord.rgaId — the producer identity and cross-device total-order key needed to merge several devices' logs into one timeline. Emits each record once, in order, replaying everything already known on collection and continuing with newly captured records until the collector is cancelled.