A premium, Chucker-inspired network monitoring tool for Kotlin Multiplatform projects. It provides a real-time UI to inspect HTTP and WebSocket traffic with advanced metrics and a dashboard.
Ensure you have mavenCentral() in your root build.gradle.kts or settings.gradle.kts:
repositories {
mavenCentral()
}[versions]
network-logger = "1.0.0"
[libraries]
network-logger = { module = "io.github.avelon1a:network-logger", version.ref = "network-logger" }dependencies {
implementation(libs.network.logger)
}Initialize the logger in your Application class to enable the persistent notification launcher.
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
NetworkLoggerProvider.logger.initialize(this)
}
}Add the NetworkLoggerPlugin to your Ktor HttpClient.
val client = HttpClient {
install(NetworkLoggerPlugin) {
logger = NetworkLoggerProvider.logger
filter = { request ->
!request.url.toString().contains("analytics.com")
}
}
}Use the WebSocketLogger bridge for manual WebSocket tracking.
val wsLogger = WebSocketLogger(NetworkLoggerProvider.logger)
// In your WebSocket listener
wsLogger.logConnected(url)
wsLogger.logMessageReceived(url, text)
wsLogger.logMessageSent(url, text)- 🔔 Access: Persistent notification with a live request counter for instant access from any screen.
- 📊 Advanced Metrics: Dedicated dashboard with success rate, latency trends (line chart), and traffic density (bar chart).
- 🎨 Premium UI: Modern Indigo/Teal aesthetic with dark mode support and glassmorphism elements.
- 🔍 Deep Inspection: View full request/response headers and bodies with status-colored badges.
- 📈 Performance Insights: Automatically identifies and highlights the slowest endpoints in your application.
commonMain: Core logic, data structures, and the main UI (Compose Multiplatform).androidMain: Android-specific initialization, Notification Launcher, and Standalone Activity.iosMain: iOS-specific hooks (ready for implementation).
Built with ❤️ for Kotlin Multiplatform development.