Sink

fun interface Sink<in C : Log.Category>

Sink for log entries.

Apps should implement the log method to receive logs from Emitters.

Example

val logger = Log.Sink<MyCategory> { category, level, source, throwable, message ->
if (level >= Log.Level.DEBUG) {
println("Event (cat: $category): ${message()}")
}
}

See also

Inheritors

Types

Link copied to clipboard

Available Sink implementations.

Functions

Link copied to clipboard
abstract fun log(category: C, level: Log.Level, source: String?, throwable: Throwable?, message: () -> String)

Log a message with the given category and level.