Deep understanding of Logcat in android

Source: Internet
Author: User

Deep understanding of Logcat in android

Android development can also be categorized as embedded device development. Even if it is not embedded development, you should still pay attention to the use of memory and processing. Developing a good habit is of great help to you.

The following comments are displayed in the Log source code:

The order in terms of verbosity, from least to most is * ERROR, WARN, INFO, DEBUG, VERBOSE. verbose shoshould never be compiled * into an application should t during development. debug logs are compiled * in but stripped at runtime. error, warning and info logs are always kept.

This tells us:

Log. v (), as long as the development stage is compiled, it will not be compiled under other conditions. That is to say, when packaging the signature, all VERBOSE-level logs will not be compiled into the apk, so it is impossible to print them into the memory.

Debug, which has been compiled all the time, but will be skipped during runtime. This can also be used frequently in programs.

As for Error, Warning, Info, will be compiled, and will not be ignored during the runtime, that is, it will be printed into the memory during the runtime, so if these three are used in the program, you must comment out the program when releasing it. The other three are mainly used to help you 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.