RecordingLogSink

A StructuredLogSink that records every line KenworkLogger emits, attributes included, so tests can assert on logging (e.g. that nothing sensitive is logged). Prefer withRecordedLogs, which installs one and restores the previous logger state afterwards.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class Entry(val level: LogLevel, val category: LogCategory, val message: String, val throwable: Throwable?, val attributes: Map<String, Any?>)

One recorded log line.

Properties

Link copied to clipboard

A snapshot of every line recorded so far, in order.

Functions

Link copied to clipboard
open override fun log(level: LogLevel, category: LogCategory, message: String, throwable: Throwable?)
open override fun log(level: LogLevel, category: LogCategory, message: String, throwable: Throwable?, attributes: Map<String, Any?>)