I need to print some str to console (Android Studio) using Kotlin. I've tried the:
Log.v()
Log.d()
Log.i()
Log.w()
Log.e()
methods. But it seems to work only on Java. What should I use to print using Kotlin? Thanks
I need to print some str to console (Android Studio) using Kotlin. I've tried the:
Log.v()
Log.d()
Log.i()
Log.w()
Log.e()
methods. But it seems to work only on Java. What should I use to print using Kotlin? Thanks
有两种方法.
You can use 100 for example but first you need to import Log
import android.util.Log
{...}
Log.d("TAG", "message")
{...}
资料来源:https://developer.android.com/reference/android/util/Log.html
You can also use kotlin's print and println function.
例子:
{...}
print("message")
println("other message")
{...}
Source: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/