diff --git a/lib/src/debug.dart b/lib/src/debug.dart index 7e0673f..df6e695 100644 --- a/lib/src/debug.dart +++ b/lib/src/debug.dart @@ -59,17 +59,28 @@ extension on String { } } +/// RxDart debug operator - Port from [RxSwift Debug Operator](https://github.com/ReactiveX/RxSwift/blob/main/RxSwift/Observables/Debug.swift) +/// /// Prints received events for all listeners on standard output. extension DebugStreamExtension on Stream { + /// RxDart debug operator - Port from [RxSwift Debug Operator](https://github.com/ReactiveX/RxSwift/blob/main/RxSwift/Observables/Debug.swift) + /// /// 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. Stream debug({ String? identifier, void Function(String)? log = print, bool trimOutput = false, }) { if (log == null) { - // logging is disabled + // logging is disabled. return this; }