DefaultPromiseLiteDebugger
public final class DefaultPromiseLiteDebugger : PromiseLiteDebugger
A default implementation of PromiseLiteDebugger.
To enable logging promises just set PromiseLiteConfig.debugger variable, like PromiseLiteConfig.debugger = DefaultPromiseLiteDebugger { print($0) }.
Example
Given the following chaining:
Promise.resolve(3)
.map { _ in throw FooError.π₯ }
.map { _ in "foo" }
.catch { _ in return "goo" }
.map { $0 }
Logs using print the follwing outputs:
π | PromiseLite<Int> resolves β
in 0.00 sec
π | PromiseLite<()> rejects β in 0.00 sec with error: π₯
π | PromiseLite<String> rejects β in 0.00 sec with error: π₯
π | PromiseLite<String> resolves β
in 0.00 sec
π | PromiseLite<String> resolves β
in 0.00 sec
-
Undocumented
Declaration
Swift
public init(_ output: @escaping (String) -> Void) -
Declaration
Swift
public func promise(description: String, initAt date: Date) -
Declaration
Swift
public func promise(description: String, resolvesAt date: Date) -
Declaration
Swift
public func promise(description: String, rejectsAt date: Date, error: Error)
DefaultPromiseLiteDebugger Class Reference