https://kotlinlang.org logo
#coroutines
Title
# coroutines
b

bjonnh

01/18/2021, 12:21 AM
How does one debug coroutines just from the logs, I got an exception (TimeoutCancellationException) that appeared randomly but it never said where it was coming from so I had to dissect my program to finally find the ktor call that was responsible. Is there something that would allow to log where the exception really happened (without having a debugger attached all the time as it is not possible in production)?
m

myungpyo.shim

01/18/2021, 6:34 AM
This link could help you. https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-debug But I'm not sure whether you use coroutine in Android or not. It has some limitations in Android.
b

bjonnh

01/18/2021, 5:39 PM
No it is on server side
1
m

myungpyo.shim

01/20/2021, 1:02 AM
Then you can use DebugProbes on the link.
👍 1
b

bjonnh

01/20/2021, 3:31 AM
Yes thanks, I looked into that and that should do it.
🙏 1
4 Views