There are a couple of ways.

You can use Log.d("TAG", "message"); for example but first you need to import Log.

import android.util.Log

{...}

Log.d("TAG", "message")

{...}

Source: https://developer.android.com/reference/android/util/Log.html

You can also use kotlin's print and println function.

Example:

{...}

print("message")

println("other message")

{...}

Source: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/

Answer from ronniemagatti on Stack Overflow
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 14158861584274-Correct-way-to-log-to-console-using-Kotlin-and-Android
Correct way to log to console using Kotlin and Android? – IDEs Support (IntelliJ Platform) | JetBrains
October 3, 2023 - Android apps do not log to console, they log to the OS logging subsystem, and you can use logcat tool window in the IDE or “adb logcat” in the terminal to view the logs.
Discussions

Console logging utility
This isn’t Kotlin, it’s Android. You want to learn how a debugger works. https://youtu.be/rjlhSDhFwzM?si=skrrjDJnJqezluWi old but gold. That or you want to profile your app but that can get very nitty gritty More on reddit.com
🌐 r/Kotlin
2
1
May 30, 2024
Why isn't this statement printing?
I'm building an object detection application (in Kotlin, for Android). The application uses CameraX to build a camera preview and Google ML to provide machine learning expertise. Just for reference; I used this CameraX documentation and this this Google ML Kit documentation. I'm currently attempting to print Log.d("TAG", "onSuccess" + it.size) to my IDE console ... More on reddit.com
🌐 r/Kotlin
4
2
October 27, 2021
Kotter (a Kotlin-idiomatic library for writing dynamic console application) hits 1.0!
You should crosspost this to r/roguelikedev . I've been hacking on a roguelike in Kotlin for a while now and this would have been a fantastic jump-start. Really cool project, nice work! More on reddit.com
🌐 r/Kotlin
28
110
October 30, 2022
How can I read a character without having to press enter?
suspend fun listenStdint(onInput: (Char) -> Unit) = launch { while (true) { val input = System.`in`.read() if (input == -1) break onInput(input.toChar()) } } fun main() = runBlocking { listenStdin { char -> doSomething(char) } } Note several things : this is omega bad in terms of performance. Because stdin acts like a file, and reading from a file is very bad in terms of performance, it's very slow the behavior is platform dependent: most platforms only flush stdin when pressing the enter key anyway (that's why readLine exists) because it is only char by char, it's very cumbersome to do anything useful with it. tldr: you really don't want to do that. More on reddit.com
🌐 r/Kotlin
8
0
August 1, 2023
🌐
Reddit
reddit.com › r/kotlin › console logging utility
r/Kotlin on Reddit: Console logging utility
May 30, 2024 -

First of all, this is a novice question. I am familiar with the Log.d/e utility to print debugging info from any Kotlin code. But, I am trying to see if there is a way to add a tool, more like a command line utility, that prints all the state information or variables that my application has, for instance, values of variables my class has. For instance, my app is Abc which is running right now, I would like to be able to go to adb shell, run a command that prints all the state information of whatever variable my Abc application's classes hold. This is of course, kind of like, developer utility but I coudn't find anything like this, or couldn't gather the idea.
Note: This would be similar to how , say, dumpsys works, because dumpsys can take multiple arguments and print information about an app and its different details.
Any suggestions ? Thanks

🌐
Delft Stack
delftstack.com › home › howto › kotlin › kotlin android print to console
How to Print to Console in Android Studio | Delft Stack
March 11, 2025 - Learn how to print messages to the console in Android Studio using Kotlin. This guide covers essential logging methods like Log.d, Log.i, and Log.e, along with advanced techniques for effective debugging. Improve your coding efficiency and streamline your development process with real-time ...
🌐
Kotlin
kotlinlang.org › docs › js-debugging.html
Debug Kotlin/JS code | Kotlin Documentation
May 11, 2026 - Now you're ready to debug your project! Run the project by calling one of the available run Gradle tasks, for example, browserDevelopmentRun or jsBrowserDevelopmentRun in a multiplatform project. Learn more about running Kotlin/JS. Start the debugging session by running the JavaScript debug configuration you've created previously: You can see the console output of your program in the Debug window in IntelliJ IDEA.
🌐
Android Developers
developer.android.com › api reference › log
Log | API reference | Android Developers
Skip to main content · English · Deutsch · Español – América Latina · Français · Indonesia · Polski · Português – Brasil · Tiếng Việt · 中文 – 简体
🌐
SentinelOne
sentinelone.com › blog › getting-started-quickly-kotlin-logging
Getting Started Quickly With Kotlin Logging | Scalyr
October 27, 2022 - Both messages go to the console: Starting log test w00t! But only the first message goes to the log file: 2019-06-15 23:20:16,969 INFO [main] production [logging.kt:3] Starting log test · The new logger inherited the output to terminal from the root logger. But, since we set its level to info, it did not inherit the debug messages. That’s a lot of control for just a few lines of code. We’ve covered the hows and the whys of Kotlin logging with Logback.
Find elsewhere
🌐
Baeldung
baeldung.com › home › libraries › guide to kotlin-logging
Guide to Kotlin-Logging | Baeldung on Kotlin
2 weeks ago - Since kotlin-logging depends on slf4j-api, which itself is a wrapper for different logging backends, we’re going to need a configuration. When we only need to log statements to standard output during development, we include org.slf4j:slf4j-simple.
🌐
GeeksforGeeks
geeksforgeeks.org › android › how-to-print-to-the-console-in-android-studio
How to Print to the Console in Android Studio? - GeeksforGeeks
July 23, 2025 - Here is the guide to Starting a new project on Android Studio. Step 2: Go to your Java or Kotlin file for the activity, and in your onCreate method write the log messages with help of the Log class.
🌐
Medium
medium.com › @abdulappengineer › from-java-to-kotlin-3b20c8eb9200
From Java To Kotlin. Print to Console | by Abdul Khalid | Medium
March 8, 2025 - var str = "Java to Kotlin Guide" var substr = "" //print java substr = str.substring(0..3) // println("substring $substr") //print kotlin substr = str.substring(8..13) println("substring $substr") Java · String text = x > 5 ? "x > 5" : "x <= 5"; String message = null; log(message != null ?
🌐
Kotlin
kotlinlang.org › api › core › kotlin-stdlib › kotlin.io › println.html
println | Core API – Kotlin Programming Language
kotlin-stdlib/kotlin.io/println · CommonJSJVMNativeWasm-JSWasm-WASI · expect fun println()(source) Prints the line separator to the standard output stream. 1.0 · expect fun println(message: Any?)(source) Prints the given message and the line separator to the standard output stream.
🌐
www.kaper.com
kaper.com › notes › java-kotlin-unit-testing-test-stdout-stderr-logs
Java/Kotlin Unit Testing – Test Stdout/Stderr/Logs
When using spring-boot unit testing (library spring-boot-test-2.6.2.jar or newer), you can capture the output as send to the standard out and standard error channels. This allows for example testing output to log statements (by sending logs to stdout / console appender).
🌐
Kotlin
kotlinlang.org › api › latest › jvm › stdlib › kotlin.io › println.html
Kotlinlang
July 12, 2023 - The Kotlin Standard Library provides ... with Kotlin. These include: Higher-order functions implementing idiomatic patterns (let, apply, use, synchronized, etc). Extension functions providing querying operations for collections (eager) and sequences (lazy). Various utilities for working with strings and char sequences. Extensions for JDK classes making it convenient to work with ...
🌐
GitHub
github.com › rmkrishna › MLog-Kotlin
GitHub - rmkrishna/MLog-Kotlin: Simple Logging library for Android in Kotlin, It will help you to print the logs in Console and also it will store the logs in File in your mobile storage. · GitHub
Simple Logging library for Android in Kotlin, It will help you to print the logs in Console and also it will store the logs in File in your mobile storage. - rmkrishna/MLog-Kotlin
Author   rmkrishna
🌐
GitHub
github.com › saschpe › Log4K
GitHub - saschpe/Log4K: Lightweight logging library for Kotlin/Multiplatform. Supports Android, iOS, JavaScript and plain JVM environments.
Lightweight logging library for Kotlin/Multiplatform. Supports Android, iOS, JavaScript and plain JVM environments. log4k: Base library, provides infrastructure and logging to the console or files with configurable rotation and retention policies.
Starred by 29 users
Forked by 6 users
Languages   Kotlin 91.8% | Shell 8.2% | Kotlin 91.8% | Shell 8.2%
🌐
PubNub
pubnub.com › kotlin
Logging for Kotlin SDK | PubNub Docs
May 12, 2026 - To implement logging using log4j you need to add the following references to the project. Using log4j you can log to console or a file or both.
🌐
YouTube
youtube.com › caleb curry
Android App Development Tutorial 19 - Console Logging with Log.d and Logcat | Java - YouTube
Entire Android Playlist - https://calcur.tech/android-java Enjoy my content? Subscribe for free! - http://calcur.tech/subscribe In todays episode we are talk...
Published   December 10, 2019
Views   5K
🌐
DigitalOcean
digitalocean.com › community › tutorials › kotlin-print-println-readline-scanner-repl
Kotlin print(), println(), readLine(), Scanner, REPL | DigitalOcean
August 3, 2022 - Today we will learn how to use Kotlin print functions and how to get and parse user input from console.
🌐
W3Schools
w3schools.com › kotlin › kotlin_output.php
Kotlin Output (Print Text)
fun main() { println("Hello World!") println("I am learning Kotlin.") println("It is awesome!") } Try it Yourself » · You can also print numbers, and perform mathematical calculations: ... There is also a print() function, which is similar to println().