File tree 1 file changed +7
-4
lines changed
core/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,18 @@ import kotlin.coroutines.experimental.AbstractCoroutineContextElement
21
21
import kotlin.coroutines.experimental.ContinuationInterceptor
22
22
import kotlin.coroutines.experimental.CoroutineContext
23
23
24
- private const val DEBUG_PROPERTY_NAME = " kotlinx.coroutines.debug"
24
+ const val DEBUG_PROPERTY_NAME = " kotlinx.coroutines.debug"
25
+ const val DEBUG_PROPERTY_VALUE_AUTO = " auto"
26
+ const val DEBUG_PROPERTY_VALUE_ON = " on"
27
+ const val DEBUG_PROPERTY_VALUE_OFF = " off"
25
28
26
29
private val DEBUG = run {
27
30
val value = try { System .getProperty(DEBUG_PROPERTY_NAME ) }
28
31
catch (e: SecurityException ) { null }
29
32
when (value) {
30
- " auto " , null -> CoroutineId ::class .java.desiredAssertionStatus()
31
- " on " , " " -> true
32
- " off " -> false
33
+ DEBUG_PROPERTY_VALUE_AUTO , null -> CoroutineId ::class .java.desiredAssertionStatus()
34
+ DEBUG_PROPERTY_VALUE_ON , " " -> true
35
+ DEBUG_PROPERTY_VALUE_OFF -> false
33
36
else -> error(" System property '$DEBUG_PROPERTY_NAME ' has unrecognized value '$value '" )
34
37
}
35
38
}
You can’t perform that action at this time.
0 commit comments