Android Development Using Logcat,logcat FAQ

Source: Internet
Author: User

What a logcat is:

This is the tool used in Android development to display the print log, similar to the System.out output in Java, but in the Android development requirements as far as possible to use logcat so not only professional, but also convenient, more importantly, the tool can be a lot of benefits and convenience, then see how convenient.

Two add Logcat to your eclipse

Click Window→show View→other in the Eclipse navigation bar to bring up a Show View dialog box. You expand the Android directory in the Show View dialog box and you see a Logcat subkey

Then select Logcat, click OK, and you will be able to add logcat to eclipse.


Three Logcat how to print the level of a log

1. LOG.V ()

This method is used to print the most trivial, least meaningful log information. The corresponding level verbose is the lowest level in the Android log.

2. LOG.D ()

This method is used to print some debugging information that should be helpful for debugging your program and analyzing the problem. The corresponding level of debug, higher than the verbose level.

3. LOG.I ()

This method is used to print some of the more important data that you would like to see that can help you analyze user behavior. corresponding level info, higher than Debug.

4. LOG.W ()

This method is used to print some warning messages, suggesting that the program may have potential risks in this place, and it is best to fix these warnings. Corresponds to level warn, one level higher than info.

5. LOG.E ()

This method is used to print error messages in a program, such as a program entering a catch statement. When the error message is printed, it usually means that your program has a serious problem and must be repaired as soon as possible. The corresponding level of error, higher than the warn level. As this method prints out is red more conspicuous

So there will be a lot of developers like to use this debugging


Four: How to display Logcat



The log information will be displayed in the text location, depending on the level of the display of different colors


You can adjust the level you want to print by default is verbose, which is printing all



You can also click on the plus sign to print according to your own custom tag. Because sometimes in the virtual machine or debugging when the printing of a lot of things so you can filter out some of the information you want according to this method.



The last one is also noteworthy, is that this search box can search for the text you want to find content, you can search directly. is not very convenient.

Android Development Using Logcat,logcat FAQ

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.