How to enable -Dkotlinx.coroutines.debug in IntelliJ IDEA? I have the following code from coroutines documentation:
fun log(msg: String) = println("[${Thread.currentThread().name}] $msg")
fun main() = runBlocking<Unit> {
val a = async {
log("I'm computing a piece of the answer")
6
}
val b = async {
log("I'm computing another piece of the answer")
7
}
log("The answer is ${a.await() * b.await()}")
}
I was trying to add this option in "Run -> Edit configuration":
but after this I expected to see the following output (as docs say):
[main @coroutine#2] I'm computing a piece of the answer
[main @coroutine#3] I'm computing another piece of the answer
[main @coroutine#1] The answer is 42
but actually I see plain usual output:
[main] I'm computing a piece of the answer
[main] I'm computing another piece of the answer
[main] The answer is 42
So how to enable this JVM option?
