install static method

Future<void> install(
  1. TracingDelegate delegate
)

Installs a TracingDelegate for the current isolate.

Only one TracingDelegate can be installed for a single isolate at any given moment.

Whether a TracingDelegate has been installed for this isolate can be checked with hasBeenInstalled.

Implementation

static Future<void> install(TracingDelegate delegate) async {
  if (_hasBeenInstalled) {
    throw StateError('A TracingDelegate has already been installed.');
  }

  _hasBeenInstalled = true;
  currentTracingDelegate = delegate;
  await addPostIsolateInitTask(delegate.initialize);
}