Search code examples
androidandroid-studioadblogcatexecution-time

How to get TimingLogger log to LogCat


I would like to use TimingLogger to log the execution time of code, but the logs don't show in LogCat.

I have tried to use adb shell setprop log.tag.YOUR_TAG VERBOSE according to Best method to measure execution time in Android? . Since adb is not listed in path variable, I had to cd to respective folder in terminal and execute it from there. After executing the command, following response is written:

* daemon not running; starting now at txp:5037
* daemon started successfully

Code used to create the logs:

TimingLogger timings = new TimingLogger("MyTag", "genext");
//some code
timings.addSplit("prepared");
//some code
timings.addSplit("loaded");
timings.dumpToLog();

with adb shell setprop log.tag.MyTag VERBOSE

Do I need to have adb set as a path variable, to function properly? Do you have any other suggestions?


Solution

  • Problem solved. Verbose log messages were not showing due to Huawai phone configuration, no problem with Android/Android Studio. If you encounter a similar problem, this helped to solve it: Huawei, logcat not showing the log for my app?