杨锴
2024-08-14 909e20941e45f8712c012db602034b47da0bfdb0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//
//  Infallible+Debug.swift
//  RxSwift
//
//  Created by Marcelo Fabri on 11/05/2023.
//  Copyright © 2023 RxSwift. All rights reserved.
//
 
extension InfallibleType {
    /**
     Prints received events for all observers on standard output.
 
     - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html)
 
     - parameter identifier: Identifier that is printed together with event description to standard output.
     - parameter trimOutput: Should output be trimmed to max 40 characters.
     - returns: An Infallible sequence whose events are printed to standard output.
     */
    public func debug(_ identifier: String? = nil, trimOutput: Bool = false, file: String = #file, line: UInt = #line, function: String = #function)
        -> Infallible<Element> {
        Infallible(
            asObservable()
            .debug(identifier, trimOutput: trimOutput, file: file, line: line, function: function)
        )
    }
}