In Android development, we will find that the SYSTEM.OUT.PRINTLN () output information becomes unusually troublesome, the virtual machine can be seen on the upside, but on the real machine, the log information constantly rolling, resulting in an instant is brushed off, So we typically use Logcat to test and debug the information that the program outputs.
The 5 letters in the upper right of Logcat represent 5 different types of log information (and are distinguished by different colors, the higher the level, the more prominent the color):
1. [V]: detailed (Verbose) information, the output color is black
2. [D]: Debug (Debug) information, output color is blue
3. [I]: Notice (info) information, output color is green
4. [W]: Warning (Warn) information, output color is orange
5. [E]: Error information, the output color is red, here the error message is the highest level, followed by a warning message, followed by notification information and debugging information, the lowest level is the details.
6.[assert], new version added.
So how do you use Logcat?
We use the log class as follows:
You'll see that the log is in various levels, and we're using the key, value mode.
When we debug the program, we can filter the information according to the conditions, so that something useful is sweeping:
By the Sihai small dense
Logcat level and debug use of Logcat