Skip to content

IOTracingOps<A>

extension IOTracingOps<A> on IO<A>

Extension providing the traced combinator on IO.

Methods

traced() extension

IO<A> traced(String label, [int? depth])

Annotates this IO with a label for tracing purposes.

When IOTracingConfig.tracingEnabled is true, the label is recorded in the fiber's trace ring buffer. When tracing is disabled, this is a no-op that returns the original IO unchanged.

depth optionally limits how many frames of the captured StackTrace are stored.

Available on IO<A>, provided by the IOTracingOps<A> extension

Implementation
dart
IO<A> traced(String label, [int? depth]) {
  if (!IOTracingConfig.tracingEnabled) {
    return this;
  } else {
    return _Traced(this, label, depth);
  }
}