I use slf4j-android in my Android application.
The doc says if I write log.trace
then it's the almost the same as I write Log.v
.
But the default logging level seems to be INFO, and logcat shows only log.info
and above, and I can't see how can I change the defaults.
1) How can I configure slf4j-android
2) If I can't: are there any other slf4j implementations for Android, more configurable
For example if your tag is MyClass
type in command line
adb shell setprop log.tag.MyClass DEBUG
The way I found is this procedure Find logger slf4j-android source here
You should see that all methods are preceded by if (isLoggable(...)) that in turn call android.util.Log isLoggable which can be found on opengrok
The description of this method explains how to set a proper property.
Note that slf4j-android will rename longer tags i.e. WiFiDirectBroadcastReceiver
will be changed to sth like *directBroadcastReceiver
.
As far as I know you cannot use * in setprop calls so you need to manage your tags carefully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With