log specification
This is the engineering specification for the MotionObservable
operator: log
.
Overview
log
writes any upstream value to the console and emits the value without modification.
Example usage:
stream.log()
upstream | downstream
20 | 20
40 | 40
80 | 80
console
20
40
80
stream.log(prefix: "The value is:")
upstream | downstream
20 | 20
40 | 40
80 | 80
console
The value is: 20
The value is: 40
The value is: 80
MVP
Expose a log operator API
Use _nextOperator
to implement the operator. Accept an optional prefix string.
class MotionObservable {
public func log(prefix: String? = nil) -> MotionObservable<T>