We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently CoroutineContext#DEBUG rely on system property kotlinx.coroutines.debug.
CoroutineContext#DEBUG
kotlinx.coroutines.debug
private const val DEBUG_PROPERTY_NAME = "kotlinx.coroutines.debug" private val DEBUG = run { val value = try { System.getProperty(DEBUG_PROPERTY_NAME) } catch (e: SecurityException) { null } when (value) { "auto", null -> CoroutineId::class.java.desiredAssertionStatus() "on", "" -> true "off" -> false else -> error("System property '$DEBUG_PROPERTY_NAME' has unrecognized value '$value'") } }
In Android we usually rely on BuildConfig.DEBUG flag which indicate if app was build in debug or production mode.
BuildConfig.DEBUG
Currently to set CoroutineContext#DEBUG value we need to use following code:
System.setProperty("kotlinx.coroutines.debug", if (BuildConfig.DEBUG) "on" else "off")
Which is not type safe, so my proposal is to:
CoroutineContext#DEBUG_PROPERTY_NAME
The text was updated successfully, but these errors were encountered:
Kotlin#316 Better way to set CoroutineContext#DEBUG value
494e023
- make `CoroutineContext#DEBUG_PROPERTY_NAME` public, also move `"on"`, `"off"`, `"auto"` to public constants as well
0bb18fc
No branches or pull requests
Currently
CoroutineContext#DEBUG
rely on system propertykotlinx.coroutines.debug
.In Android we usually rely on
BuildConfig.DEBUG
flag which indicate if app was build in debug or production mode.Currently to set
CoroutineContext#DEBUG
value we need to use following code:Which is not type safe, so my proposal is to:
CoroutineContext#DEBUG_PROPERTY_NAME
public, also move "on", "off", "auto" to public constants as wellCoroutineContext#DEBUG
valueThe text was updated successfully, but these errors were encountered: