Giter Site home page Giter Site logo

android10 / frodo Goto Github PK

View Code? Open in Web Editor NEW
1.5K 29.0 103.0 231 KB

Android Library for Logging RxJava Observables and Subscribers.

Java 98.09% Groovy 1.69% Batchfile 0.10% Shell 0.11%
android rxjava android-development android-library debugger debugging debugging-tool

frodo's Introduction

Frodo

Hex.pm Platform Download

Frodo is an android library inspired by Jake Wharton's Hugo, mainly used for logging RxJava Observables and Subscribers outputs on the logcat. It generates and weaves code based on annotations only on debug versions of the application where the plugin is applied, for instance, it is safe to persist any Frodo annotation in the codebase.

frodo_hug

Main Features

  • @RxLogObservable: Annotated methods which return rx.Observables will print the following information when emitting items:

frodo_observable

    @RxLogObservable
    public Observable<List<MyDummyClass>> list() {
        return Observable.just(buildDummyList());
    }
  • @RxLogObservable.Scope Options: It is possible to narrow down the debug information shown by adding a debugging scope to @RxLogObservable annotation.

    • Scope.EVERYTHING: Logs stream data, schedulers and rx.Observable events. Default.
    • Scope.STREAM: Logs rx.Observable emitted items plus total execution time.
    • Scope.SCHEDULERS: Logs schedulers where the annotated rx.Observable operates on.
    • Scope.EVENTS: Logs rx.Observable events only.
    • Scope.NOTHING: Turns off logging for the annotated rx.Observable.
    @RxLogObservable(Scope.STREAM)
    public Observable<List<MyDummyClass>> list() {
        return Observable.just(buildDummyList());
    }
  • @RxLogSubscriber: Annotated classes which are of type rx.Subscriber will print the following information when receiving items from an rx.Observable:

frodo_subscriber

@RxLogSubscriber
public class MySubscriberBackpressure extends Subscriber<Integer> {

    @Override
    public void onStart() {
        request(40);
    }

    @Override
    public void onNext(Integer value) {
        //empty
    }

    @Override
    public void onError(Throwable throwable) {
        //empty
    }

    @Override
    public void onCompleted() {
        if (!isUnsubscribed()) {
            unsubscribe();
        }
    }
}

Enabling Frodo

To enable Frodo, a gradle plugin must be applied in your build.gradle:

buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath "com.fernandocejas.frodo:frodo-plugin:${latest_version}"
  }
}

apply plugin: 'com.android.application'
apply plugin: 'com.fernandocejas.frodo'

//By default frodo is ON on debug build variants, although
//we can enable-disable it with this configuration.
frodo {
  enabled = true
}

Known issues

1 - Multi module setup (application + android library) will not log annotated methods/classes from Android Library Module but will do it on Android Application Module. The reason behind this, is that the Android Gradle Plugin will build all Android Libraries as release versions, for instance, Frodo is not able to weave any code on the annotated methods/classes (Remember that only weaves in debug versions). There is a workaround for forcing debug versions of your Android Libraries (just be careful in case this is forgotten and you end up shipping a version of your app with RxJava Logging enabled) by adding this line in your build.gradle file:

android {
  defaultPublishConfig "debug"
}

Frodo WIKI

For complete information, features and usage, refer to the WIKI:

License

Copyright 2015 Fernando Cejas

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

http://www.fernandocejas.com

Buy Me A Coffee

frodo's People

Contributors

android10 avatar dbacinski avatar m0er avatar simplysoft avatar spirosoik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frodo's Issues

No Logoutput at all

Hey,

first thanks for your effort @android10.

I set up a project inspired by your clean-architecture repo (so I am using multi-modules). I (for example) put annotations on the DefaultSubscriber class (which is exactly as it is in your c-a repo). The defaultPublishConfig is added to all project build.gradle files. Everything compiles fine.

The Problem is that I don't get any output at all.

Excerpt from the build.gradle:

apply plugin: 'com.fernandocejas.frodo'

android {
    defaultPublishConfig "debug"
[...]```

Any ideas why there is no output? (As I don't have errors I can't post them)

App is crashing with NullPointerException on Android 4.2.2

Caused by: java.lang.NullPointerException at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27)
I just use Observable.just(SomethingList), but sometimes SomethingList will be a empty list(not null), or when I use Observable.empty(), and then it is crashing when use @RxLogObservable.

NullPointerException: RxLogObservable (Android 7.1.1)

Nexus 5x
Nexus 6p
Android 7.1.1

In some cases throwing NPE:

java.lang.NullPointerException: Attempt to invoke interface method 'com.fernandocejas.frodo.annotation.RxLogObservable$Scope com.fernandocejas.frodo.annotation.RxLogObservable.value()' on a null object reference
at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27) ~[na:0.0]
at [...].GenericRestRefreshTokenProvider$1.call(GenericRestRefreshTokenProvider.java) ~[na:0.0]
at [...].GenericRestRefreshTokenProvider$1.call(GenericRestRefreshTokenProvider.java:53) ~[na:0.0]
at rx.internal.util.InternalObservableUtils$RetryNotificationDematerializer.call(InternalObservableUtils.java:223) ~[na:0.0]
at rx.internal.util.InternalObservableUtils$RetryNotificationDematerializer.call(InternalObservableUtils.java:214) ~[na:0.0]
at rx.internal.operators.OnSubscribeRedo.call(OnSubscribeRedo.java:280) ~[na:0.0]
at rx.internal.operators.OnSubscribeRedo.call(OnSubscribeRedo.java:47) ~[na:0.0]
at rx.Observable.unsafeSubscribe(Observable.java:10144) ~[na:0.0]
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48) ~[na:0.0]
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33) ~[na:0.0]
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[na:0.0]
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[na:0.0]
at rx.Observable.unsafeSubscribe(Observable.java:10144) ~[na:0.0]
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48) ~[na:0.0]
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33) ~[na:0.0]
at rx.Observable.unsafeSubscribe(Observable.java:10144) ~[na:0.0]
at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94) ~[na:0.0]
at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230) ~[na:0.0]
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) ~[na:0.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428) ~[na:0.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:237) ~[na:0.0]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272) ~[na:0.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) ~[na:0.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) ~[na:0.0]
at java.lang.Thread.run(Thread.java:761) ~[na:0.0]

there is bug on android api 15,but wok on api 22 is ok in my app.

Caused by: java.lang.NullPointerException
at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27)
at com.jytcorp.ingot.data.sqlite.dataset.AccountTable.getDefaultUser(AccountTable.java)
at com.jytcorp.ingot.data.sqlite.IngotDB.getDefaultUser(IngotDB.java:38)
at com.jytcorp.ingot.data.DataServiceProvider.getUser(DataServiceProvider.java:62)
at com.jytcorp.ingot.domain.manager.UserManager.getUser(UserManager.java:19)

RxLogSubscriber for subjects or hot observable

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)

NPE in annotated method: Observable<Void>

Caught this exception:

E/AndroidRuntime( 9441): java.lang.NullPointerException
E/AndroidRuntime( 9441):    at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27)

Happened for a method with the following signature:

@RxLogObservable
private Observable<Void> method(View view);

Does not work with retrolambda

@android10 , thanks for this tool, it's very helpful!

I've just started some side project to play with RxJava. I'm using retrolambda as it cleans a code a little, but it seems that this plugin breaks down Frodo's logging.

Is it a bug in Frodo or just the way retrolambda is magic messing with aspectj? I can live without retrolambda, but I suppose there are projects heavy relying on this, maybe it would be nice to mention about it on main page?

Support @RxLogObservable on Java interfaces

Investigate whether is technically possible:

AspectJ provides a JoinPoint where frodo detects the return type and inject code to log observables.
By returning an interface I should search for all implementations in the code and weave logging code in each one of them?

@RxLogObservable not working on interface method

I'm using Retrofit2 and let it return instances of Observable<Response<Payload>>. If I annotate such a method with @RxLogObservable and kick off a request, I cannot see anything in Logcat.

Now, I'm not exactly sure if I'm doing everything right, since the interface in question resides in a module and yes, I have set android { defaultPublishConfig "debug" } set globally for all my Android modules.

Is logging supposed to work on interface methods?

NPE when enabling proguard optimization

We get the following exception when we have proguard optimization turned on

Caused by: java.lang.NullPointerException
         at com.fernandocejas.frodo.joinpoint.FrodoJoinPoint.getGenericReturnTypes(FrodoJoinPoint.java:124)
         at com.fernandocejas.frodo.aspect.LogObservable.weaveAroundJoinPoint(LogObservable.java:5022)

We have a rather special setup (debug built type & minify configuration similar to release), so this kind of problems we are not really unexpected, but would be good to make the code more resilient to just fall back to do nothing.

About minSdkVersion  question.

My English is not good, I hope you can understand.
this minSdkVersion is 14, but i want turn down 10.
Can you give me some advise to cope with this problem?

Failing Verification causing Crash

needed to xxxx most of the code but something fails during the verification of toString
crashes the app. Only happens on a Samsung I9190 Galaxy S4 mini as far as i can tell.

W/dalvikvm: VFY: invoke type does not match method type of Ljava/lang/Object;.toString
07-28 16:19:47.213 4395-6657/xxx.dev.debug W/dalvikvm: VFY: rejecting opcode 0x70 at 0x002c
07-28 16:19:47.213 4395-6657/xxx.dev.debug W/dalvikvm: VFY: rejected LxxxxModel$AjcClosure3;.access$super (LxxxxModel$AjcClosure3;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;
07-28 16:19:47.213 4395-6657/xxxx.dev.debug W/dalvikvm: Verifier rejected class LxxxModel$AjcClosure3;

Disable Frodo using Gradle

This is related to #19. As an alternative it would be good to have the ability to manually disable frodo, similar as it is possible with hugo, something like this:

frodo {
  enabled false
}

Kotlin support

As more and more code in our app is being migrated to Kotlin we'd like to use Frodo there as well. However it seem that Kotlin isn't supported as of now.

However when using the Frodo annotations exclusively in Kotlin code we receive

advice defined in com.fernandocejas.frodo.aspect.LogSubscriber has not been applied [Xlint:adviceDidNotMatch]
advice defined in com.fernandocejas.frodo.aspect.LogSubscriber has not been applied [Xlint:adviceDidNotMatch]

This error doesn't appear and the Java code logging works, but in both cases logging for Kotlin classes doesn't work.

Hugo is suffering the same problem: JakeWharton/hugo#121

Frodo + Robolectric NullPointerException

Whenever I run my tests, the ones who use Frodo annotated methods get a NullPointerException. It looks like they don't get well with Robolectric. Do they?

java.lang.NullPointerException
    at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27)
    at xxx.widget.ExpandingAutoFitRecyclerView.getExpansionObservable(ExpandingAutoFitRecyclerView.java)
    at xxx.shows.series.SeriesListViewImpl.onListExpansionChanged(SeriesListViewImpl.java:174)
    at xxx.shows.ShowActivity.setupSubscriptions(ShowActivity.java:175)
    at xxx.shows.ShowActivity.onResume(ShowActivity.java:128)
    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1185)
    at android.app.Activity.performResume(Activity.java:5182)
    at org.robolectric.util.ReflectionHelpers$3.run(ReflectionHelpers.java:162)
    at org.robolectric.util.ReflectionHelpers.traverseClassHierarchy(ReflectionHelpers.java:305)
    at org.robolectric.util.ReflectionHelpers.callInstanceMethod(ReflectionHelpers.java:156)
    at org.robolectric.util.ComponentController$1.run(ComponentController.java:72)
    at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:304)
    at org.robolectric.shadows.CoreShadowsAdapter$2.runPaused(CoreShadowsAdapter.java:45)
    at org.robolectric.util.ComponentController.invokeWhilePaused(ComponentController.java:69)
    at org.robolectric.util.ActivityController.resume(ActivityController.java:153)
    at xxx.shows.ShowActivityTest.setUp(ShowActivityTest.java:64)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:251)
    at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:188)
    at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:152)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

The failing method is:

@Pointcut("execution(@com.fernandocejas.frodo.annotation.RxLogObservable * *(..)) && if()")
public static boolean methodAnnotatedWithRxLogObservable(ProceedingJoinPoint joinPoint) {
    FrodoProceedingJoinPoint frodoJoinPoint = new FrodoProceedingJoinPoint(joinPoint);
    Annotation annotation = frodoJoinPoint.getAnnotation(RxLogObservable.class);
    return ((MethodSignature)joinPoint.getSignature()).getReturnType() == Observable.class && ((RxLogObservable)annotation).value() != Scope.NOTHING;
}

Do you need more info?

Logs from onSubscribe() does not log which thread it happened in

I'm using version

classpath "com.fernandocejas.frodo:frodo-plugin:0.8.2"

I have

@RxLogObservable
    Observable<String> createObservable(final String name){
        Log.d("createObservable " + name, "create " + Thread.currentThread().getName());
        return Observable.create(new Observable.OnSubscribe<String>() {
            @Override
            public void call(Subscriber<? super String> subscriber) {
                Log.d("createObservable " + name, "create call " + Thread.currentThread().getName());
                subscriber.onNext(Thread.currentThread().getName());
                subscriber.onCompleted();
            }
        }).doOnSubscribe(new Action0() {
            @Override
            public void call() {
                Log.d("createObservable " + name, "create doOnSubscribe " + Thread.currentThread().getName());
            }
        });
    }

    @RxLogSubscriber
    class MySubscriber extends Subscriber<String>{

        String loglog;

        public MySubscriber(String loglog) {
            this.loglog = loglog;
        }

        @Override
        public void onCompleted() {
            Log.d("createObservable " + loglog, "onCompleted");
        }

        @Override
        public void onError(Throwable e) {
            Log.d("createObservable " + loglog, "onError " + e);
        }

        @Override
        public void onNext(String s) {
            Log.d("createObservable " + loglog, "onNext this thread " + Thread.currentThread().getName() + " Observable " + s);
        }
    }

then I call it with

createObservable(">1<")
                .observeOn(Schedulers.computation())
                .subscribeOn(Schedulers.computation())
                .subscribe(new MySubscriber(">1<"));

Output is:

Frodo => [@Observable :: @InClass -> GOApp :: @Method -> createObservable(name='>1<')]
createObservable >1<: create main
Frodo => [@Observable#createObservable -> onSubscribe()]
createObservable >1<: create doOnSubscribe RxComputationThreadPool-1
createObservable >1<: create call RxComputationThreadPool-1

While I expect this

Frodo => [@Observable :: @InClass -> GOApp :: @Method -> createObservable(name='>1<')]
createObservable >1<: create main
Frodo => [@Observable#createObservable -> onSubscribe() **RxComputationThreadPool-1**]
createObservable >1<: create doOnSubscribe RxComputationThreadPool-1
createObservable >1<: create call RxComputationThreadPool-1

NPE when using RxLogObservable

I always get this exception when using it:

java.lang.NullPointerException: Attempt to invoke interface method 'com.fernandocejas.frodo.annotation.RxLogObservable$Scope com.fernandocejas.frodo.annotation.RxLogObservable.value()' on a null object reference
                                                                           at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27)

Method looks like this:

@RxLogObservable
public Observable<Stories> getStories() {
    return myService.getStories();
}

RxLogObservable annotation for entire class.

Hi Fernando. Thanks for this awesome library :)

I've just integrated it in my current project and it works perfectly. The problem is that I needed to annotation like 50 methods xD

I've annotated every public method for every one of my repositories (and most of their methods have a public visibility). So, I think it will be nice to have an annotation with target ElementType.TYPE in order to be able to annotate an entire class (or repository for that matters), and selecting the methods to be logged based on the visibility scope selected (by default only public).

Do you think this is is technically possible? And if so, would you accept a PR -previously discussing the api?

Hardcoded bintray fetching of runtime

We're doing debug build where frodo is enabled on our Jenkins, which resides in a rather restricted environment, meaning that no outgoing HTTP traffic is allowed and dependencies are fetched through an internal Nexus instance.

When I build with frodo enabled on that machine, I get

> Could not resolve com.fernandocejas.frodo:frodo-runtime:0.8.1.
    > Could not get resource 'http://dl.bintray.com/android10/maven/com/fernandocejas/frodo/frodo-runtime/0.8.1/frodo-runtime-0.8.1.pom'.
        > Could not GET 'http://dl.bintray.com/android10/maven/com/fernandocejas/frodo/frodo-runtime/0.8.1/frodo-runtime-0.8.1.pom'.

Is there any way to make this configurable?

Implement for RxJava 2

Please implement logging for new RxJava 2
Caused by: java.lang.ClassNotFoundException: Didn't find class "rx.Observable" on path: DexPathList[[zip file "/data/app/***/base.apk"],nativeLibraryDirectories=[/data/app/***/lib/x86, /system/lib, /vendor/lib]]
Thanks for your support.

@RxLogSubscriber NullPointerException

There are a few problems with a library dude which I will try to solve and send a PR. I found that if send an empty observable back or a null value back then the RxLogSubscriber crashes with NullPointerException. If I removed it then the subscriber works normally.

Dynamic implementation in doOnError() or onErrorResumeNext for release builds

It will be great to have the ability to add dynamic implementations for logging purposes for doOnError() or onErrorResumeNext.

eg. imagine that we want to track logs for crash reporting reasons for our data layer, so what we could do, is to create a custom ErrorLoggingAction and we could attach it manually. Another option is to create an observable facade which it could include this logging automatically.

But imagine the interface RxLogObservableAdapter which can implement our logic there and we must init it once in Application class.

Customizable Logging implementation

It would be nice if there is a way to provide a custom DebugLog implementation, so that logging with other libraries (e.g. via log4j, Timber) could be achieved

Gradle sync error

After bumping plugin version, gradle sync fails on sample app module and I am not able to build library. The same problem occurs while building commit on jitpack.

Error:A problem occurred configuring project ':frodo-android-sample'.
> Could not resolve all dependencies for configuration ':frodo-android-sample:classpath'.
   > Could not find com.fernandocejas.frodo:frodo-plugin:0.8.4.
     Searched in the following locations:
         file:/XXX/Android Studio 1.5/gradle/m2repository/com/fernandocejas/frodo/frodo-plugin/0.8.4/frodo-plugin-0.8.4.pom
         file:/XXX/Android Studio 1.5/gradle/m2repository/com/fernandocejas/frodo/frodo-plugin/0.8.4/frodo-plugin-0.8.4.jar
         https://jcenter.bintray.com/com/fernandocejas/frodo/frodo-plugin/0.8.4/frodo-plugin-0.8.4.pom
         https://jcenter.bintray.com/com/fernandocejas/frodo/frodo-plugin/0.8.4/frodo-plugin-0.8.4.jar
         https://repo1.maven.org/maven2/com/fernandocejas/frodo/frodo-plugin/0.8.4/frodo-plugin-0.8.4.pom
         https://repo1.maven.org/maven2/com/fernandocejas/frodo/frodo-plugin/0.8.4/frodo-plugin-0.8.4.jar
         file:/XX/.m2/repository/com/fernandocejas/frodo/frodo-plugin/0.8.4/frodo-plugin-
     Required by:
         com.fernandocejas.frodo:frodo-android-sample:0.8.4

https://jitpack.io/com/github/dbacinski/frodo/f87c2c4113/build.log

NullPointerException

I've caught this stacktrace, please check if it's relevant:

     Caused by: java.lang.NullPointerException
            at android.util.Pair.hashCode(Pair.java:62)
            at java.lang.Object.toString(Object.java:332)
            at java.lang.String.valueOf(String.java:1681)
            at com.fernandocejas.frodo.internal.MessageBuilder.buildObservableOnNextMessage(MessageBuilder.java:92)
            at com.fernandocejas.frodo.internal.MessageManager.printObservableOnNext(MessageManager.java:34)
            at com.fernandocejas.frodo.internal.FrodoObservable$5.call(FrodoObservable.java:42)
            at rx.Observable$11.onNext(Observable.java:4417)
            at rx.internal.operators.OperatorDoOnEach$1.onNext(OperatorDoOnEach.java:79)
            at rx.observers.Subscribers$5.onNext(Subscribers.java:234)
            at rx.internal.operators.NotificationLite.accept(NotificationLite.java:150)
            at rx.internal.util.RxRingBuffer.accept(RxRingBuffer.java:443)
            at rx.internal.operators.OnSubscribeCombineLatest$MultiSourceProducer.tick(OnSubscribeCombineLatest.java:152)
            at rx.internal.operators.OnSubscribeCombineLatest$MultiSourceProducer.onNext(OnSubscribeCombineLatest.java:209)
            at rx.internal.operators.OnSubscribeCombineLatest$MultiSourceRequestableSubscriber.onNext(OnSubscribeCombineLatest.java:257)
            at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:472)
            at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:434)
            at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:227)
            at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:140)
            at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.slowpath(OnSubscribeFromIterable.java:97)
            at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.request(OnSubscribeFromIterable.java:73)
            at rx.Subscriber.setProducer(Subscriber.java:211)
            at rx.internal.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:49)
            at rx.internal.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:32)
            at rx.Observable$2.call(Observable.java:162)
            at rx.Observable$2.call(Observable.java:154)
            at rx.Observable.unsafeSubscribe(Observable.java:7710)
            at rx.internal.operators.OnSubscribeCombineLatest$MultiSourceProducer.request(OnSubscribeCombineLatest.java:131)
            at rx.Subscriber.setProducer(Subscriber.java:211)
            at rx.Subscriber.setProducer(Subscriber.java:205)
            at rx.Subscriber.setProducer(Subscriber.java:205)
            at rx.Subscriber.setProducer(Subscriber.java:205)
            at rx.Subscriber.setProducer(Subscriber.java:205)
            at rx.Subscriber.setProducer(Subscriber.java:205)
            at rx.Subscriber.setProducer(Subscriber.java:205)
            at rx.Subscriber.setProducer(Subscriber.java:205)
            at rx.internal.operators.OnSubscribeCombineLatest.call(OnSubscribeCombineLatest.java:68)
            at rx.internal.operators.OnSubscribeCombineLatest.call(OnSubscribeCombineLatest.java:45)
            at rx.Observable

observeOn() / subscribeOn() thread detection

Is it supposed to be like this by design: when I hide observeOn() / subscribeOn() behind compose(), for example, in logs I see:

... -> onSubscribe() :: @SubscribeOn -> main

Frankly, looking through some logs right now I don't see any other thread apart from "main"; I have to inject standard logging with Thread.currentThread() inside operators to check that it's not the main thread. I haven't tried it with primitive observables though.

Another example will also print "main" thread:

Observable.defer(...).subscribeOn(Schedulers.io()).mergeWith(Observable.<Bitmap> just(null));

Frodo with proguard

My app code contains frodo annotations.
Can I run release version of my app without deleting frodo annotations?
And also I don't want to get this exception in production:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.annotation.Annotation java.lang.reflect.Method.getAnnotation(java.lang.Class)' on a null object reference

Failed to apply plugin 'com.fernandocejas.frodo'

I updated my project to

classpath 'com.android.tools.build:gradle:7.0.4'
distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-all.zip

now I am phasing this problem.

A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.fernandocejas.frodo'.
Could not find method compile() for arguments [com.fernandocejas.frodo:frodo-api:0.8.3] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.