samedi 3 janvier 2015

Android logging: filter from the application itself

Is there a way to programmatically configure an Android application to filter the log messages sent to logcat? I do understand, that logcat can be configured to filter out stuff, but I want to do the same inside the Android application.


Use case - I am actually using robolectric for my test cases, that I can run directly on my host machine and not on an emulator. This is actually extremely convenient for non-GUI stuff. Some of my code emits Android logs. I cannot attach logcat to see the output of that. I can redirect logs to regular stdout. But at this point I don't have filtering, so it's either grep or similar or sieving through thousands of lines of irrelevant stuff.


Aucun commentaire:

Enregistrer un commentaire