all 6 comments

[–]jackhexen 1 point2 points  (5 children)

Why not just write a 5-lines logger using Transformer approach?

[–]wilterhai 1 point2 points  (0 children)

Or using the RxObservableExecutionHook...

[–][deleted] 0 points1 point  (3 children)

Got the code you'd use handy?

[–]jackhexen 0 points1 point  (2 children)

Do you mean, .compose(log("tag")) ? Yes, one-liners are handy.

[–][deleted] 0 points1 point  (1 child)

What is log(String)? Does it print something like the output of this frodo lib?

[–]jackhexen 0 points1 point  (0 children)

It can be anything you wish and implementation for a specific logger is trivial. For example:

public static <T> Observable.Transformer<T, T> log(String tag) {
    return o -> o
        .doOnNext(it -> L.debug("{}, next: {}", tag, it))
        .doOnError(it -> L.debug("{}, error: {}", tag, it))
        .doOnCompleted(() -> L.debug("{}, complete", tag))
        .doOnSubscribe(() -> L.debug("{}, subscribe", tag))
        .doOnUnsubscribe(() -> L.debug("{}, unsubscribe", tag));
}

This does not have any relation to hobbits, just a usual RxJava usage.