Reputation: 525
This is first time i have added any module in my project. I have added android vitamio inside my project. All the things are working except the play/pause touch listener. The code seems to be written right . i have also tried putting the listener inline but no luck. However when i debug the code and execute line by line i can see the code running as expected. I have also put log.d() command inside MediaController class to track the execution but none of the log command written in the class if vitamio module gets printed. i am wondering if the log commands of added modules do not get printed at the same window where my main project's log commands do. can one please suggest on this.
Upvotes: 3
Views: 999
Reputation: 39
I had a similar problem when I used android.util.Log
to print logs in app module and timber.log.Timber
to print in another library/module.
By saying that I mean the app module didn't have access to the separate library/module dependencies (like Timber) due to Gradle's implementation
keyword configuration instead of api
keyword in latter. So I forgot to unify them and used two different APIs for logging.
The first solution was to change implementation
keyword to api
for Timber dependency in the separate library/module (however you need to pay attention to it as implementation
-based configuration in libs/modules stands for build-time optimization in favor for your APK, adding api
will add some complexity to it, try to avoid it for dependencies if there is no important purpose to be accessible).
Another (light-weight) solution was just to make sure to use only one API logging standard. For example if you use:
Log.d(TAG, "Print something from the app module")
So you need to use the same type of logging in your library/separate module, not the Timber one:
Log.d(TAG, "Print something from a different module")
In other case:
if your app level has the access to Timber dependency from another module or Timber is added to app level gradle file & your separate module has it as well - you can use Timber logging API in both.
Upvotes: 0
Reputation: 2166
Those module logs are part of the full project. You can filter and display specific log only if the module send it
Upvotes: 0