Why can't TimingLogger print logs?

I am trying to use TimingLogger to check the time spent on a particular method and its validation. But Android TimingLogger cannot print magazines.

+6
source share
2 answers

If Log.isLoggable is not enabled, at least for the Log.VERBOSE level for this tag, addSplit and dumpToLog will do nothing during the creation of the request.

If you are just looking for magazines, as described at https://developer.android.com , you won’t be able to see the magazines. So use the command below in adb:

adb shell setprop log.tag.MyTag VERBOSE

Note : MyTag is the first parameter that you passed when creating a new TimingLogger, as shown below:

TimingLogger timings = new TimingLogger("MyTag", "MyMethodName");

And here you are. Happy coding !!!

+15
source

Besides changing the log level, I also had to reset the TimeLogger to set the mDisabled flag. You can do this with timingLogger.reset()

0
source

All Articles