Canard is a lightweight Kotlin Multiplatform logging library with a simple API, working on:
- JVM / Android
- iOS, as well as all Kotlin/Native targets
- JavaScript / WasmJS
Canard allows you to:
- Easily set up logging in a Kotlin Multiplatform
- Log what you need on different levels
- Avoid worrying about platform-specific frontend implementations
Canard is a good choice because:
- It integrates nicely with all Kotlin/Multiplatform targets
- It has a straightforward design with a user-friendly and comprehensible API.
repositories {
mavenCentral()
}
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("org.kodein.log:canard:{version}")
}
}
}
}
// Simple example
val loggerFactory = LoggerFactory(defaultLogFrontend)
val logger = newLogger(loggerFactory)
logger.info { "Welcome to ..." }
logger.warning { "... the Canard documentation!" }
See Canard documentation.