KodioLogging

Central configuration and dispatch for Kodio's multiplatform logging facade.

Silent by default. No log output is produced until you configure a minimum level and at least one KodioLogWriter.

Enable logging

KodioLogging.configure {
minLevel = LogLevel.Debug
addWriter(platformLogWriter())
}

Or from the library entry point:

Kodio.configureLogging {
minLevel = LogLevel.Info
addWriter(platformLogWriter())
}

Disable logging

KodioLogging.minLevel = LogLevel.None
// or
KodioLogging.clearWriters()

Custom writers

Add any number of KodioLogWriter instances; each log event is forwarded to every writer. Replace the full set with setWriters, append with addWriter, or reset with clearWriters.

Properties

Link copied to clipboard

Minimum level to emit. Defaults to LogLevel.None (fully silent).

Functions

Link copied to clipboard

Appends a writer to the current set.

Link copied to clipboard

Removes all writers. Combined with minLevel = LogLevel.None, logging stays silent.

Link copied to clipboard
fun configure(block: KodioLogging.() -> Unit)

Configures logging in a single block.

Link copied to clipboard

Returns whether level would be emitted given current configuration.

Link copied to clipboard
fun setWriters(vararg writers: KodioLogWriter)

Replaces all writers with the given set.

Link copied to clipboard

Returns a snapshot of the currently registered writers.