TestSink

A LogSink implementation designed for testing purposes. It stores all emitted LogEvents in an in-memory list for verification.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The list of events captured by this sink.

Functions

Link copied to clipboard
fun clear()

Clears all captured events.

Link copied to clipboard
open override fun emit(event: LogEvent)

Emits a log event to the output destination.

Link copied to clipboard
open fun flush()

Flushes any buffered log events. Called automatically when a FATAL log occurs or during shutdown.

Link copied to clipboard

Checks if any event with the specified level was captured.

Link copied to clipboard

Returns the most recently captured event, or null if no events have been captured.

Link copied to clipboard

Returns a list of messages for all captured events with the specified level.