refactor: replace all println/printStackTrace logging with Kermit#245
Merged
codebutler merged 1 commit intomasterfrom Feb 24, 2026
Merged
refactor: replace all println/printStackTrace logging with Kermit#245codebutler merged 1 commit intomasterfrom
codebutler merged 1 commit intomasterfrom
Conversation
e4f2be8 to
91c591b
Compare
Adopt Kermit (co.touchlab:kermit:2.0.8) as the KMP logging framework
across the entire codebase, replacing ad-hoc println(), printStackTrace(),
and System.err.println() calls with structured, level-filtered logging.
- Add kermit dependency to gradle/libs.versions.toml and base/build.gradle.kts
(as api() so all downstream modules inherit it)
- Replace ~50 println() calls with Logger.withTag("Tag").x { } using
appropriate levels (d/i/w/e)
- Replace all 5 printStackTrace() calls with log.e(throwable) { }
- Add logging to ~15 silent catch blocks (catch (_: Exception))
- Remove manual DEBUG flag in Usb4JavaPN533Transport.kt (Kermit handles
log level filtering)
- Add CLAUDE.md rule #10 documenting Kermit logging conventions
Scope: all production Kotlin code (commonMain, androidMain, iosMain,
wasmJsMain, jvmMain). Excluded: tools/mdst/ CLI utilities and test files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
91c591b to
3868ab5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
println(),printStackTrace(), andSystem.err.println()calls with structured, level-filteredLogger.withTag("Tag").x { }loggingcatch (_:blocks that previously swallowed exceptions without any traceDEBUGflag inUsb4JavaPN533Transport.kt(Kermit handles log level filtering)#10documenting Kermit logging conventionsDetails
51 files changed across all platforms (commonMain, androidMain, iosMain, wasmJsMain, jvmMain).
Modules touched:
base/,card/(classic, cepas, felica, ultralight, iso7816, ksx6924, vicinity),app/(ViewModels, desktop backends, web),transit/(erg, china, tfi-leap, troika, calypso, pilet, smartrider, bip, serialonly),flipper/.Out of scope (unchanged):
tools/mdst/CLI utilities (intentional stdout/stderr output) and test files.Log level mapping:
log.d— protocol debug traces, expected failureslog.i— informational status (firmware version, card detected, polling)log.w— operation failures handled gracefullylog.e— errors indicating real problemsTest plan
./gradlew allTestspassesprintln()remaining in production Kotlin code (verified via grep)printStackTrace()remaining🤖 Generated with Claude Code