android10 / android10/frodo

RxLogSubscriber for subjects or hot observable

未关闭
#24 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
feature request
主要语言
Java
星标
1.5k
派生
99
PR 合并指标
30 天内没有已合并 PR

描述

Currently logging shared hot observable or subject via RxLogObservable could result in unreadable log:

Assume we have a subject returned as observable and we just want to log its emission (and possibly - subscribers count)
Currently it's only possible to annotate a method with RxLogObservable

```
BehaviorSubject bus = BehaviorSubject.create();

@RxLogObservable Observable bus() {
return bus.asObservable();
}
...
bus.onNext(theEvent);
...
Subscription subscription1 = bus().subscribe()
...
Subscription subscriptionN = bus().subscribe()
```

And for each Subscriber we'll have a log entry per emission/completion/error, entries are equal though

```
Frodo => [@Observable#bus() -> onNext() -> theEvent] // <-- subscription1
...
Frodo => [@Observable#bus() -> onNext() -> theEvent] // <-- subscriptionN
```

RxLogObservable is a neat way for logging observables, however it makes logs totally unreadable if one has several subjects and subscribers for them.

So it would be cool to enhance existent annotation or add a new one to log only subject's (subscriber's) onNext/etc (It seems more natural to log subjects as RxLogSubscriber since we're essentially interested in its onNext invocations, however we cannot annotate single instance with it, it's applicable for class only)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。