Android development 3 -- View and output log information

Source: Internet
Author: User

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.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.