Skip to content

Instantly share code, notes, and snippets.

@vincentbrison
Last active December 14, 2019 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentbrison/37b88537898d815eae46552a39b041e0 to your computer and use it in GitHub Desktop.
Save vincentbrison/37b88537898d815eae46552a39b041e0 to your computer and use it in GitHub Desktop.
Enable kotlin coroutine debug mode on Android
fun setupCoroutineDebugMode() {
val debugProperty = if (BuildConfig.DEBUG) {
kotlinx.coroutines.DEBUG_PROPERTY_VALUE_ON
} else {
kotlinx.coroutines.DEBUG_PROPERTY_VALUE_OFF
}
System.setProperty(kotlinx.coroutines.DEBUG_PROPERTY_NAME, debugProperty)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment