Anko Logging with verbose and debug not working

I am trying to use Anko Commons - Logging

but for some reason the verbose and debug data is not showing on the logcat

however, when I use Log.d it works as expected.

when i try to use this code

verbose("-------------verbose--------------")
debug("-------------debug--------------")
info("-------------info--------------")
warn("-------------warn--------------")
error("-------------error--------------")
wtf("-------------wtf--------------")

      

the logarithm of the log looks like this: enter image description here

I am using Anko 0.10.0 android studio 3.0 canary-5

when i tried to find a solution i found this

All Log. * will be logged to logcat regardless of the current log level. However, AnkoLogger. * Will only log to logcat when the log level is logged.

but I don't know how to change the log level, and even if my problem is the same.

+3


source to share


1 answer


It turns out that the default log level is INFO.

From the ADB shell, you can change the log level to DEBUG, VERBOSE, etc. using the following command:

setprop  log.tag.MyApp  DEBUG

      



So, to the best of our knowledge AnkoLogger uses Log.isLoggable()

under the hood which by default ignores the log levels VERBOSE

and DEBUG

.

for more information you can read more about it here

+2


source







All Articles