Package-level declarations

Pipeline internals and the immutable event model. DefaultLogger assembles the read-only LogEvent (timestamp, level, tag, message, throwable, attributes, resolved context, thread name). LogPipeline filters via LogPolicy and fans out to every sink; FATAL flushes then throws. LoggerConfig configures minLevel and per-tag overrides. LogContext and LogContextHolder carry contextual key-value data merged into every event.

Pipeline internals and the immutable event model. DefaultLogger assembles the read-only LogEvent (timestamp, level, tag, message, throwable, attributes, resolved context, thread name). LogPipeline filters via LogPolicy and fans out to every sink; FATAL flushes then throws. LoggerConfig configures minLevel and per-tag overrides. LogContext and LogContextHolder carry contextual key-value data merged into every event.

Pipeline internals and the immutable event model. DefaultLogger assembles the read-only LogEvent (timestamp, level, tag, message, throwable, attributes, resolved context, thread name). LogPipeline filters via LogPolicy and fans out to every sink; FATAL flushes then throws. LoggerConfig configures minLevel and per-tag overrides. LogContext and LogContextHolder carry contextual key-value data merged into every event.

Pipeline internals and the immutable event model. DefaultLogger assembles the read-only LogEvent (timestamp, level, tag, message, throwable, attributes, resolved context, thread name). LogPipeline filters via LogPolicy and fans out to every sink; FATAL flushes then throws. LoggerConfig configures minLevel and per-tag overrides. LogContext and LogContextHolder carry contextual key-value data merged into every event.

Pipeline internals and the immutable event model. DefaultLogger assembles the read-only LogEvent (timestamp, level, tag, message, throwable, attributes, resolved context, thread name). LogPipeline filters via LogPolicy and fans out to every sink; FATAL flushes then throws. LoggerConfig configures minLevel and per-tag overrides. LogContext and LogContextHolder carry contextual key-value data merged into every event.

Pipeline internals and the immutable event model. DefaultLogger assembles the read-only LogEvent (timestamp, level, tag, message, throwable, attributes, resolved context, thread name). LogPipeline filters via LogPolicy and fans out to every sink; FATAL flushes then throws. LoggerConfig configures minLevel and per-tag overrides. LogContext and LogContextHolder carry contextual key-value data merged into every event.

Pipeline internals and the immutable event model. DefaultLogger assembles the read-only LogEvent (timestamp, level, tag, message, throwable, attributes, resolved context, thread name). LogPipeline filters via LogPolicy and fans out to every sink; FATAL flushes then throws. LoggerConfig configures minLevel and per-tag overrides. LogContext and LogContextHolder carry contextual key-value data merged into every event.

Pipeline internals and the immutable event model. DefaultLogger assembles the read-only LogEvent (timestamp, level, tag, message, throwable, attributes, resolved context, thread name). LogPipeline filters via LogPolicy and fans out to every sink; FATAL flushes then throws. LoggerConfig configures minLevel and per-tag overrides. LogContext and LogContextHolder carry contextual key-value data merged into every event.

Types

Link copied to clipboard

A builder for creating a map of log attributes.

Link copied to clipboard
@RequiresOptIn(level = RequiresOptIn.Level.ERROR, message = "This is an internal KMP Logger API reserved for the logger-coroutines module. Use LogContextHolder.withContext, withSuspendingContext, or withLogContext instead. This API may change incompatibly or be removed without notice.")
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class InternalLoggerApi

Marks API that is internal to the KMP Logger library and reserved exclusively for the logger-coroutines module.

Link copied to clipboard
data class LogContext(val values: Map<String, Any?> = emptyMap())

A context container that holds a map of values to be included in log events.

Link copied to clipboard
actual object LogContextHolder

Holds and propagates the active LogContext for the current execution scope.

actual object LogContextHolder

Holds and propagates the active LogContext for the current execution scope.

expect object LogContextHolder

Holds and propagates the active LogContext for the current execution scope.

actual object LogContextHolder

Holds and propagates the active LogContext for the current execution scope.

actual object LogContextHolder

Holds and propagates the active LogContext for the current execution scope.

actual object LogContextHolder

Kotlin/Native coroutines are not single-threaded - Dispatchers.Default is a multi-threaded worker pool. Without ThreadLocal this object's state would be one process-wide slot, so concurrent coroutines on different threads would read each other's context - i.e. silently wrong context data.

actual object LogContextHolder

Kotlin/Native coroutines are not single-threaded - Dispatchers.Default is a multi-threaded worker pool. Without ThreadLocal this object's state would be one process-wide slot, so concurrent coroutines on different threads would read each other's context - i.e. silently wrong context data.

actual object LogContextHolder

Holds and propagates the active LogContext for the current execution scope.

Link copied to clipboard
data class LogEvent(val level: LogLevel, val loggerName: String, val message: String?, val throwable: Throwable?, val attributes: Map<String, Any?>, val context: LogContext, val thread: String, val timestamp: Long)

Represents a single log event captured at a point in time.

Link copied to clipboard

Configuration for the logger.