Lens-Logger
1.1.0indexedFacilitates code sharing across Android and iOS platforms, organizing shared code into structured folders for platform-specific implementations and integrating with SwiftUI for iOS apps.
Facilitates code sharing across Android and iOS platforms, organizing shared code into structured folders for platform-specific implementations and integrating with SwiftUI for iOS apps.
LensLogger is a Kotlin Multiplatform (KMP) library for Android, iOS and Desktop that makes debugging network requests effortless. It automatically logs all Ktor network requests and responses, and provides a built-in UI to inspect these logs directly in your app. This helps you quickly identify issues and monitor network activity during development.
| Android | iOS | Desktop (Windows) |
|---|---|---|
![]() | ![]() |
Add the LensLogger artifact to your module's commonMain dependencies:
dependencies {
implementation("io.github.farhazulmullick:lens-logger:<version>")
}
Or add to your libs.versions.toml:
lensLoggerVersion = "<version>"
lens-logger = { module = "io.github.farhazulmullick:lens-logger", version.ref = "lensLoggerVersion" }
In your shared code (e.g., commonMain):
import io.github.farhazulmullick.lenslogger.*
import io.ktor.client.*
import io.ktor.client.engine.*
import io.ktor.client.plugins.logging.*
client = HttpClient(engine) {
LensHttpLogger {
level = LogLevel.ALL
logger = : Logger {
{
Napier.d(message = message)
}
}
}.also {
Napier.base(DebugAntilog())
}
}
client = HttpClient(engine) {
install(LensHttpLogger){
level = LogLevel.ALL
}
}
Simply wrap your app's root composable with LensApp. This will enable the LensLogger UI and log request/response in your app.
import io.github.farhazulmullick.lenslogger.ui.LensApp
import androidx.compose.ui.Modifier
LensApp(
modifier = Modifier.fillMaxSize(),
// by default enabled, set to false to disable.
showLensFAB = true,
// Optional: For DataStore Visualizer
dataStores = listOf(DataStores<Preferences>)
) {
// Your app content goes here
App()
}
This will display your app content and allow you to open the LensLogger UI overlay for network log inspection.
Note: Make sure you have set up LensLogger with your Ktor client as shown above in your network module.
This project is licensed under the MIT License - see the LICENSE file for details.

![]() |
Surfaced from shared tags and platforms — no rankings paid for.