I. error level
Error> warn> info> debug> verbose (redundancy)
Ii. View Android project logs
The console view can only view the information of the Project deployed on the simulator. The development log information can only be found inLogcatView. You can click a button in the logcat view to filter errors. For example, if you click info, the log information with the error level greater than or equal to info is displayed.
Iii. log output
Private final string tag = "xylog";/*** method 1. It is recommended that you precisely define the information level */Public void testlog1 () throws exception {string myname = "XY"; log. I (TAG, myname); // information level log. E (TAG, "Err"); // error level log. E (TAG, "error"); // garbled characters are displayed in the logcat view, this is a view issue, not a program issue}/*** method 2 */Public void testlog2 () throws exception {// information level system. out. println ("XY");}/*** method 3 */Public void testlog3 () throws exception {// warning level system. err. println ("XY ");}
The above information is output to the logcat view for developers to view.