debug method

Single<T> debug({
  1. String? identifier,
  2. void log(
    1. String
    )? = print,
  3. bool trimOutput = false,
})

RxDart debug operator - Port from RxSwift Debug Operator

Prints received events for all listeners on standard output.

The identifier is printed together with event description to standard output. If identifier is null, it will be current stacktrace, including location, line and member.

If log is null, this Stream is returned without any transformations. This is useful for disabling logging in release mode of an application.

If trimOutput is true, event text will be trimmed to max 40 characters.

Implementation

Single<T> debug({
  String? identifier,
  void Function(String)? log = print,
  bool trimOutput = false,
}) =>
    Single.safe(
      DebugStreamExtension(this).debug(
        identifier: identifier ?? Trace.current(1).frames.first.formatted,
        log: log,
        trimOutput: trimOutput,
      ),
    );