Skip to content
Back to skills

Kmp Logging

ASecurity

Multiplatform logging in Kotlin Multiplatform with Kermit (co.touchlab:kermit:2.2.0). Use when adding logging to shared code - the global Logger, severity levels (v/d/i/w/e/a), Logger.withTag for per-class tags, configuring LogWriters and minSeverity, building a custom Logger with StaticConfig, and routing warnings/errors to Crashlytics or Bugsnag. Kermit writes to Logcat on Android and OSLog on iOS automatically; Napier is a lighter alternative. For Android-only Logcat/ADB/ANR debugging use ...

  • 16 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 11, 2026
developmentkotlindebuggingapi

Works with

  • api

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add TalissonVitorino/kmp-ios-skills --skill kmp-logging --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Kmp Logging?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Kmp Logging
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/talissonvitorino-kmp-logging/badge)](https://www.skillsdirectory.com/skills/talissonvitorino-kmp-logging)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: kmp-logging
description: Multiplatform logging in Kotlin Multiplatform with Kermit (co.touchlab:kermit:2.2.0). Use when adding logging to shared code - the global Logger, severity levels (v/d/i/w/e/a), Logger.withTag for per-class tags, configuring LogWriters and minSeverity, building a custom Logger with StaticConfig, and routing warnings/errors to Crashlytics or Bugsnag. Kermit writes to Logcat on Android and OSLog on iOS automatically; Napier is a lighter alternative. For Android-only Logcat/ADB/ANR debugging use android-skills:android-debugging; for analytics events (not logs) use analytics-patterns.
---

# KMP Logging (Kermit)

## Overview

**Kermit** (Touchlab) is the standard KMP logging library — log from `commonMain` and it writes to **Logcat** on Android and **OSLog** on iOS automatically (console on JS). Current version **2.0.7**. Logs flow through composable `LogWriter`s, so you can also send them to Crashlytics/Bugsnag.

## When to use

- Logging from shared code (`commonMain`)
- Tagged loggers per class/feature
- Sending warnings/errors to crash reporting
- Controlling verbosity per build (`minSeverity`)

## Dependency

```kotlin
commonMain.dependencies {
    implementation("co.touchlab:kermit:2.2.0")
    // implementation("co.touchlab:kermit-crashlytics:2.0.7") // optional
}
```

## Usage

```kotlin
// Global logger — lambda message is only built if it will actually be logged
Logger.i { "App started" }
Logger.e(throwable) { "Failed to load user $id" }

// Tagged logger per class
class UserRepository {
    private val log = Logger.withTag("UserRepository")
    fun load() { log.d { "loading…" } }
}
```

Severities, low → high: `v` `d` `i` `w` `e` `a`.

## Configure writers + severity (once, at startup)

```kotlin
Logger.setMinSeverity(if (isDebug) Severity.Verbose else Severity.Warn)
Logger.setLogWriters(platformLogWriter(), CrashlyticsLogWriter())

// or a fully custom instance:
val log = Logger(
    config = StaticConfig(
        minSeverity = Severity.Info,
        logWriterList = listOf(platformLogWriter()),
    ),
    tag = "MyApp",
)
```

## Common mistakes

| Mistake | Fix |
|---|---|
| String concatenation in hot log paths | Use the lambda form `{ "x=$x" }` — skipped below `minSeverity` |
| Same verbosity in release | Raise `minSeverity` for release builds |
| Expecting iOS logs in Logcat | iOS writes to **OSLog** (Console.app / Xcode), not Logcat |
| Crash logs not appearing | Add `CrashlyticsLogWriter` to the writer list |

## See also

- Android Logcat / ADB / ANR debugging: `android-skills:android-debugging`
- Analytics events (distinct from logs): `analytics-patterns`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.