KiteLog

object KiteLog

The logging policy, as a contract rather than a framework.

KitePlayer never prints on its own. Every line the engine would say goes through this one seam, which is SILENT until an application installs a sink, and becomes silent again when the sink is removed. There are no log levels to configure inside the player, no files, no timestamps and no formatting: the sink gets the tag and the message and owns everything else, because the application, not the library, knows where its logs belong.

The player's own record-keeping does not depend on this: warnings are always kept in the bounded history KitePlayer.warningHistory and printed by KitePlayer.diagnosticsDump, sink or no sink.

Types

Link copied to clipboard
fun interface Sink

Receives every line the engine says while installed. Called from engine threads.

Link copied to clipboard
fun interface StructuredSink

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

Properties

Link copied to clipboard

Whether URIs in messages and field values are reduced to a bare filename. On by default.

Functions

Link copied to clipboard
fun install(sink: KiteLog.Sink?)

Installs sink, replacing any previous sink of either kind. Null returns the player to silence.

Link copied to clipboard

Installs sink, replacing any previous sink of either kind. Null returns the player to silence.

Link copied to clipboard
fun log(tag: String, message: String, fields: Map<String, String> = emptyMap())

Sends one line to the installed sink, redacted as redactUris says, and does nothing while no sink is installed. The engine and KitePlayer's other modules log through this call.