public static class RxTracingPolicy.LogSubscriptionTrace extends Object implements RxTracingPolicy
RxTracingPolicy which logs the stack trace of every subscription, so
that it can decorate any exceptions with the stack trace at the time they were subscribed.
This logging is fairly expensive, so you might want to set the LogDisposableTrace#shouldLog field,
which determines whether a subscription is logged or passed along untouched.
By default every Rx.onValue(java.util.function.Consumer<T>) listener will be logged, but nothing else.
To enable this tracing policy, do one of the following:
DurianPluginsRxTracingPolicy.LogSubscriptionTrace| Modifier and Type | Field and Description |
|---|---|
static BiPredicate<Object,RxListener<?>> |
shouldLog
The BiPredicate which determines which subscriptions should be logged.
|
NONE| Constructor and Description |
|---|
LogSubscriptionTrace() |
| Modifier and Type | Method and Description |
|---|---|
<T> RxListener<T> |
hook(Object observable,
RxListener<T> listener)
Given an observable, and an
Rx which is about to be subscribed to this observable,
return a (possibly instrumented) `Rx`. |
public static BiPredicate<Object,RxListener<?>> shouldLog
public <T> RxListener<T> hook(Object observable, RxListener<T> listener)
RxTracingPolicyRx which is about to be subscribed to this observable,
return a (possibly instrumented) `Rx`.hook in interface RxTracingPolicyobservable - The IObservable, Observable, or ListenableFuture which is about to be subscribed to.listener - The Rx which is about to be subscribed.Rx which may (or may not) be instrumented. To ensure that the program's behavior
is not changed, implementors should ensure that all method calls are delegated unchanged to the original listener eventually.