[slf4j-user] slf4j-android 1.6.1-RC1 - How do I set log level?

Yaron Goland yarong at microsoft.com
Wed Nov 13 21:17:33 CET 2013


I am using slf4j-android 1.6.1-RC1 via gradle/maven and when I call Log.debug nothing comes out in Logcat under Android Studio 0.3.5 when I run an application in the emulator.

Just for fun I tried the following:

        private final Logger Log = LoggerFactory.getLogger(MainActivity.class);
                ...
        Log.debug("Got this far, woohoo!");
        android.util.Log.d("blah","I am here!");

The Log.d's output did appear in Logcat but Log.debug did not.

I checked Log.isDebugEnabled() and sure enough it is set to false. But that seems weird since android.util.Log.d works just fine. Shouldn't slf4j be using the same log level? In fact, shouldn't slf4j just be calling android.util.Log under the covers?

I also replaced Log.debug with Log.error and that did work. So the problem seems to be that slf4j has somehow decided that debug events shouldn't be emitted even though Log.d will emit them.

How do I set the log level in Android for slf4j?

Help!

                                Thanks

                                                Yaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20131113/83bdb3da/attachment.html>


More information about the slf4j-user mailing list