Package mu

Types

Appender
Link copied to clipboard
interface Appender
interface Appender
ConsoleOutputAppender
Link copied to clipboard
object ConsoleOutputAppender : Appender
object ConsoleOutputAppender : Appender
DefaultMessageFormatter
Link copied to clipboard
object DefaultMessageFormatter : Formatter
object DefaultMessageFormatter : Formatter
Formatter
Link copied to clipboard
interface Formatter
interface Formatter
KLoggable
Link copied to clipboard
interface KLoggable

An interface representing class with logging capabilities implemented using a logger obtain a logger with logger() method

KLogger
Link copied to clipboard
expect interface KLogger
actual interface KLogger
actual interface KLogger : Logger

An extension for Logger with Lazy message evaluation example:

actual interface KLogger
KLogging
Link copied to clipboard
open class KLogging : KLoggable

A class with logging capabilities usage example:

KMarkerFactory
Link copied to clipboard
expect object KMarkerFactory

A platform independent factory to create markers.

actual object KMarkerFactory
actual object KMarkerFactory
actual object KMarkerFactory
KotlinLogging
Link copied to clipboard
expect object KotlinLogging
actual object KotlinLogging
actual object KotlinLogging
actual object KotlinLogging
KotlinLoggingConfiguration
Link copied to clipboard
object KotlinLoggingConfiguration
object KotlinLoggingConfiguration
KotlinLoggingLevel
Link copied to clipboard
enum KotlinLoggingLevel : Enum<KotlinLoggingLevel>
enum KotlinLoggingLevel : Enum<KotlinLoggingLevel>
Marker
Link copied to clipboard
expect interface Marker

A platform independent marker to enrich log statements.

actual interface Marker
actual typealias Marker = Marker
actual interface Marker
NamedKLogging
Link copied to clipboard
open class NamedKLogging(name: String) : KLoggable

A class with logging capabilities and explicit logger name

Functions

isLoggingEnabled
Link copied to clipboard
fun KotlinLoggingLevel.isLoggingEnabled(): Boolean
fun KotlinLoggingLevel.isLoggingEnabled(): Boolean
toKLogger
Link copied to clipboard
fun Logger.toKLogger(): KLogger
withLoggingContext
Link copied to clipboard
inline fun <T> withLoggingContext(vararg pair: Pair<String, String?>, restorePrevious: Boolean = true, body: () -> T): T

Use a vary number of pairs in MDC context. Example:

inline fun <T> withLoggingContext(pair: Pair<String, String?>, restorePrevious: Boolean = true, body: () -> T): T

Use a pair in MDC context. Example:

inline fun <T> withLoggingContext(map: Map<String, String?>, restorePrevious: Boolean = true, body: () -> T): T

Use a map in MDC context. Example: