kmp-logging

Configures kotlin-logging or Kermit logging with Koin injection for Kotlin Multiplatform projects.

2|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/ronjunevaldoz/kmp-agent-skills --skill kmp-logging-ronjunevaldoz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kmp-logging
Source: https://github.com/ronjunevaldoz/kmp-agent-skills/tree/main/skills/kmp-logging
Command: npx skills add https://github.com/ronjunevaldoz/kmp-agent-skills --skill kmp-logging-ronjunevaldoz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up logging in Kotlin Multiplatform projects often leads to scattered logger construction, backend lock-in, and feature modules coupled directly to logging libraries. This Skill provides a consistent pattern for wrapping kotlin-logging or Kermit behind a stable facade, wiring it through Koin, and bridging warnings and errors to crash reporters. ## Core Features & Use Cases - Backend-agnostic wrapper contract: Define a small LoggerFacade and LoggerFactory interface in commonMain so feature modules never depend on kotlin-logging or Kermit directly. - Gradle and version catalog setup: Add kotlin-logging or Kermit to libs.versions.toml and wire it through a build-logic convention plugin so features receive logging transitively. - Koin logger factory injection: Inject a LoggerFactory once in the core module so every ViewModel and layer gets a tagged logger without constructing it directly. - Crash reporting bridge: Route warn and error messages as breadcrumbs to Firebase Crashlytics or Sentry through a BreadcrumbSink kept in infrastructure. - Use Case: When adding logging to a KMP app with auth, product, and order features, use this Skill to create the wrapper in :core:common, wire the factory in Koin, and keep test output quiet with a no-op logger in commonTest. ## Quick Start Ask the agent to set up KMP logging with a kotlin-logging wrapper, Koin factory injection, and a Crashlytics breadcrumb bridge in the core module.

Frequently Asked Questions about kmp-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up logging in a Kotlin Multiplatform project?▼

Add kotlin-logging or Kermit to libs.versions.toml, expose it through a convention plugin in build-logic, and define a small LoggerFacade interface in commonMain. Feature modules inject the wrapper via Koin instead of depending on the backend library directly.

kotlin-logging vs Kermit for KMP logging?▼

Both are KMP-native and work well behind a wrapper facade. kotlin-logging provides a consistent Kotlin-style API across targets, while Kermit is a good fit for projects already using it. Pick one backend per project and keep it uniform behind the wrapper.

How do I inject loggers with Koin in KMP?▼

Register a LoggerFactory as a Koin factory in the core module that creates a tagged LoggerFacade per consumer. ViewModels and other classes then receive the factory through constructor injection instead of constructing loggers themselves.

Can I send KMP logs to Crashlytics or Sentry?▼

Yes, add a BreadcrumbSink bridge that forwards warn and error messages to the crash reporter as breadcrumbs and records exceptions. Keep the bridge in the infrastructure module so feature code never touches crash SDK APIs.

How do I silence logs in KMP unit tests?▼

Inject a no-op LoggerFacade implementation in commonTest or configure the test backend to suppress output. Do not reuse production logging configuration in tests, and verify that quiet-test setup does not leak output.

Why are my KMP logs not appearing on a specific target?▼

Check that the correct backend artifact is declared for that target and that the wrapper factory is wired in Koin before feature code executes. Missing per-target artifacts are the most common cause of silent loggers.