
Unified cross-platform logging solution simplifies message logging for Android and iOS with a single API, featuring color-coded log levels and platform-specific outputs for efficient debugging.
The LogKat is a Kotlin Multiplatform (KMP) library that provides a unified solution for logging across Android and iOS platforms. This library simplifies cross-platform logging by eliminating the need for separate platform-specific code. With a single API, you can log messages that will appear in Android's Logcat or iOS's console, depending on the platform your app is running on.
Developers using Kotlin Multiplatform (KMP) often write separate logging logic for Android and iOS. This library eliminates that complexity by providing a single-line logging solution that works for both platforms. Here's why LogKat makes sense for your project:
Here’s a sample of the log output in the iOS terminal console:
Here’s a sample of the log output in Android Logcat:
To use LogKat, add the following dependency in your Kotlin Multiplatform project:
dependencies {
implementation("io.github.prashant17d97:logkat:1.0.0")
}Ensure your project is retrieving dependencies from Maven Central:
repositories {
mavenCentral()
}The library provides a simple API that handles platform-specific logging:
import io.github.prashant17d97.logkat.LogKat
LogKat.i("TestLogKat", "This is an informational message")
LogKat.d("TestLogKat", "Debugging message for developers")
LogKat.w("TestLogKat", "Warning: Something might be wrong!")
LogKat.v("TestLogKat", "Verbose message for detailed logging")
LogKat.e("TestLogKat", "Error occurred! Please investigate.")2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social D DebugTest
2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social E ErrorTest
2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social I InfoTest
2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social V VerboseTest
2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social W WarningTest
2024-10-19 21:19:00.972524+0530 Connect[4962:41146884] 🔵 D MainApp DebugTest
2024-10-19 21:19:00.972600+0530 Connect[4962:41146884] 🔴 E MainApp ErrorTest
2024-10-19 21:19:00.972657+0530 Connect[4962:41146884] 🟢 I MainApp InfoTest
2024-10-19 21:19:00.972727+0530 Connect[4962:41146884] 🟣 V MainApp VerboseTest
2024-10-19 21:19:00.972786+0530 Connect[4962:41146884] 🟡 W MainApp WarningTest
The following log levels are supported, and each is color-coded:
LogKat abstracts platform-specific logging:
This means you use one line of code for both platforms without any additional platform checks or specific code.
If you have any questions or would like to collaborate, feel free to reach out!
Contributions to the project are always welcome! Feel free to open issues or submit pull requests on GitHub.
This library is distributed under the MIT License. You are free to use, modify, and distribute it under the terms of this license.
The LogKat is a Kotlin Multiplatform (KMP) library that provides a unified solution for logging across Android and iOS platforms. This library simplifies cross-platform logging by eliminating the need for separate platform-specific code. With a single API, you can log messages that will appear in Android's Logcat or iOS's console, depending on the platform your app is running on.
Developers using Kotlin Multiplatform (KMP) often write separate logging logic for Android and iOS. This library eliminates that complexity by providing a single-line logging solution that works for both platforms. Here's why LogKat makes sense for your project:
Here’s a sample of the log output in the iOS terminal console:
Here’s a sample of the log output in Android Logcat:
To use LogKat, add the following dependency in your Kotlin Multiplatform project:
dependencies {
implementation("io.github.prashant17d97:logkat:1.0.0")
}Ensure your project is retrieving dependencies from Maven Central:
repositories {
mavenCentral()
}The library provides a simple API that handles platform-specific logging:
import io.github.prashant17d97.logkat.LogKat
LogKat.i("TestLogKat", "This is an informational message")
LogKat.d("TestLogKat", "Debugging message for developers")
LogKat.w("TestLogKat", "Warning: Something might be wrong!")
LogKat.v("TestLogKat", "Verbose message for detailed logging")
LogKat.e("TestLogKat", "Error occurred! Please investigate.")2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social D DebugTest
2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social E ErrorTest
2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social I InfoTest
2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social V VerboseTest
2024-10-19 21:15:13.217 6142-6142 MainApp com.connect.social W WarningTest
2024-10-19 21:19:00.972524+0530 Connect[4962:41146884] 🔵 D MainApp DebugTest
2024-10-19 21:19:00.972600+0530 Connect[4962:41146884] 🔴 E MainApp ErrorTest
2024-10-19 21:19:00.972657+0530 Connect[4962:41146884] 🟢 I MainApp InfoTest
2024-10-19 21:19:00.972727+0530 Connect[4962:41146884] 🟣 V MainApp VerboseTest
2024-10-19 21:19:00.972786+0530 Connect[4962:41146884] 🟡 W MainApp WarningTest
The following log levels are supported, and each is color-coded:
LogKat abstracts platform-specific logging:
This means you use one line of code for both platforms without any additional platform checks or specific code.
If you have any questions or would like to collaborate, feel free to reach out!
Contributions to the project are always welcome! Feel free to open issues or submit pull requests on GitHub.
This library is distributed under the MIT License. You are free to use, modify, and distribute it under the terms of this license.