If you’re writing Kotlin for Android, use android.util.Log—most commonly Log.d(TAG, "message") for a debug message. View the output in Android Studio’s Logcat. Flutter’s debugPrint is a Dart API, not a Kotlin function, and its behavior is not identical to Android logging.
Print a debug message in Android Kotlin
Import Android’s Log class, define a tag that identifies the source, and call Log.d where you want to record a diagnostic message:
import android.util.Log
private const val TAG = "MyFeature"
fun loadData() {
Log.d(TAG, "Loading data")
}
Android’s Log API provides methods for several priorities: Log.v (verbose), Log.d (debug), Log.i (informational), Log.w (warning), and Log.e (error). A tag helps identify which part of the app emitted a message.
See Kotlin messages in Android Studio
Run the Android app, open Android Studio’s Logcat window, and select or filter the device and app messages you want to inspect. Logcat displays device logs in real time; Android’s Logcat guide explains its available filters and controls.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
How this differs from Flutter’s debugPrint
| Difference | Flutter debugPrint |
Android Kotlin Log |
|---|---|---|
| Runtime and API | Dart API documented by Flutter (debugPrint reference) | Android API, android.util.Log (Log reference) |
| Where to view output | Flutter documents viewing logs with flutter logs (Flutter debugging guide) |
Android Studio’s Logcat |
| Priorities and tags | The cited debugPrint API describes a print callback; it does not provide the Android Log.v/d/i/w/e method set |
Priority-specific methods and a tag argument are available |
| Output throttling | Flutter says the default implementation crudely throttles output to help avoid data loss on Android (DebugPrintCallback documentation) | The cited Android Log reference does not describe equivalent default throttling |
| Release builds | Flutter documents that debugPrint logs even in release mode; use a debug-mode check or an assert when the call should be debug-only (debugPrint reference) |
The cited Android Log reference does not establish that a debug-priority call is automatically removed from release builds |
Flutter also warns that interleaving debugPrint and print can make messages appear out of order. For Flutter-specific logging details, see its debugging guide.
Keep debug-only logging out of release behavior
Do not infer that a function is stripped from a release build just because its name contains “debug.” Flutter explicitly says debugPrint logs in release mode unless you guard the call with a debug-mode check or an assert. The cited Android documentation identifies Log.d as a debug-priority logging method, but does not say that calls are automatically removed from release builds; use an explicit project-appropriate guard if that is required.
Rank #2
If your Kotlin code is not Android code
android.util.Log is the Android-specific answer, not a portable Kotlin equivalent. Kotlin Multiplatform, server-side Kotlin, and desktop JVM applications run in different environments, so choose logging based on the target runtime rather than assuming Android’s API is available.
Quick Recap
Best Value
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




