Android Development notes: One minute learn how to use the Logcat debug program _android

Source: Internet
Author: User
It's a simple question, but it's always a bit of a problem to use after a certain amount of time. Here is a note of the Logcat steps:
1, in the activity to affirm the tag variable (name is actually casual, as follows:
private static final String tag= "Yan";
2, when you need to use Logcat output information:
LOG.I (Tag, "screen width:" +display.getwidth () + "screen height:" +display.getheight ());
3, double click Logcat, click "+" add a new logcat filter, a total of three places need to write information. respectively is logcat filter corresponding to the LOG.I, by the log tag corresponds to Yan (tag's content, and the above corresponds), by the log level to select info (this is the above with Log.i,i on behalf of the meaning of info). Screenshot below:

Then you can debug the program by printing information! If logcat is not open, click window---show view----other--android---logcat to choose from.

Note: If the LOGCAT information is still not visible after a few steps, it is sometimes because the verbose or info in the following image is not selected (that is, the corresponding to you above, my picture is verbose).


Related Article

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.