platformTraceSink

@ExperimentalStructuredCoroutines
actual fun platformTraceSink(): TraceSink?(source)

Actual for Android: returns a new AndroidTraceSink with default settings.

The default system-trace sink for the current target, or null when :runtime ships none (every target except Android). Null is the degraded answer, not an error: compose your own sinks.

Example:

val sink = platformTraceSink() ?: LoggingSink(log = ::println)
val dispatchers = DefaultDispatcherProvider.traced(sink)

Requires opting in to ExperimentalStructuredCoroutines.

Platform availability (expect/actual): returns an AndroidTraceSink on Android and null on every other target (JVM, JS, Native, Wasm). On the JVM use the separate :runtime-tracing artifact for Perfetto output.

Return

a new sink for the target's system tracer, or null when none ships with :runtime.

See also

@ExperimentalStructuredCoroutines
actual fun platformTraceSink(): TraceSink?(source)

Actual for JS: returns null, no system tracer ships with :runtime.

@ExperimentalStructuredCoroutines
actual fun platformTraceSink(): TraceSink?(source)

Actual for the JVM: returns null; use PerfettoTraceSink from :runtime-tracing for system-trace output.

Actual for Native: returns null, no system tracer ships with :runtime.

@ExperimentalStructuredCoroutines
actual fun platformTraceSink(): TraceSink?(source)

Actual for Wasm (JS): returns null, no system tracer ships with :runtime.

Actual for Wasm (WASI): returns null, no system tracer ships with :runtime.