StructuredSink

fun interface StructuredSink

Receives every line with the FIELDS behind it, rather than flattened into prose.

A warning knows its own type, and often a stream index or a URI, and the plain Sink loses all of that into a sentence that a structured logging backend then has to parse back out with a regular expression. This hands them over instead: warning is always present, and whatever else the warning carries is beside it.

Installing either kind of sink replaces the other; there is one seam, not two.

Functions

Link copied to clipboard
abstract fun event(tag: String, message: String, fields: Map<String, String>)