If you want to debug the android source code or conduct Process Research on a module of Android, it is essential to view logs.
However, the number of logs provided by the system is too small to be tracked.
So how can we let the system provide more logs.
After researching the source code, we can find that the source code is used in a large amount when printing logs.
Public static Boolean isloggable (string tag, int level)
By taking a closer look at the API, we can see that this method is to compare the Log Level of the corresponding tag with the level. If it is not smaller than the level, it will be printed. Almost all systems are judged at the verbose level, and the default Log Level of the system is info.
In this case, the system only prints info information, and a lot of verbose information is invisible.
How can we change the default Log Level of some system applications.
There are two methods, one is to create a file/data/local. Prop
log.tag.<YOUR_LOG_TAG>=<LEVEL>
The front is the log label, followed by the level.
In the ADB shell, enter the command
setprop log.tag.<YOUR_LOG_TAG> <LEVEL>
Of course, it is better to change the level to verbose if you want to view detailed logs.
I personally prefer the second method, which is relatively simple.
For example, you only need to enter
In this way, you can see detailed verbose-level logs.
Someone may want to ask how to obtain the tag. I found this in the source code. If you need the tag of another application, I will add it to the article later.
Wu Dongdong lastsweetop -- 20110817
Reprinted please indicate the source: http://blog.csdn.net/lastsweetop/article/details/6696217