CapturingLogWriter

class CapturingLogWriter : LogWriter(source)

A Kermit writer that records every line, for tests that assert what was or was not logged. Hand it to Logger(loggerConfigInit(writer)), or install it on the global Logger and call uninstall in teardown.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Entry(val severity: Severity, val tag: String, val message: String, val throwable: Throwable?)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun assertNotLogged(vararg values: String)

Asserts that something was logged and that no message or attached throwable text contains any of values.

Link copied to clipboard
open fun isLoggable(tag: String, severity: Severity): Boolean
Link copied to clipboard
open override fun log(severity: Severity, message: String, tag: String, throwable: Throwable?)
Link copied to clipboard
fun messages(severity: Severity? = null): List<String>