Deep understanding of Logcat in Android

Source: Internet
Author: User

Android development can also be categorized as embedded device development, even if not embedded development, still need to pay attention to the use of memory and processing. It's great to develop a good habit to help yourself.

You can see this comment in the source code of the log:

The order in terms of verbosity, from least to most are * ERROR, WARN, INFO, DEBUG, VERBOSE.  Verbose should never be compiled * to an application except during development.  Debug logs is compiled * in but the stripped at runtime.  Error, warning and info logs is always kept.

This tells us:

LOG.V (), as long as the development phase is compiled, other conditions will not be compiled. In other words, when you package a signature, all verbose-level logs are not compiled into the APK, and it is impossible to print to memory.

Debug, which has been compiled all the time, is skipped at runtime and can be used frequently in programs.

As for the error,warning,info, it will be compiled, the runtime will not be ignored, that is, when the runtime is printed into memory, so if the program used in these three, in the release of the program must be commented out. The other three main uses are more convenient to find log logs.

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.