Introduction and use of logcat in Android

Source: Internet
Author: User

Introduction and use of logcat in Android
Zookeeper

Levels of logcat logs are sorted from low to high.

Verbose: redundancy, minimum level. Black

Debug: debug information blue

Info: normal information green

Warning: Orange warning

Error: error red

Assert: the highest assertion level

Debugging information is usually printed through debug or info

The output information of System. out and System. err is also displayed in LogCat,

Note that the output information of System. out is Info-level and System. err is Warn-level.

 

Android has its own debugging method: You can customize tags and levels.

// Android provides a special method for printing output.

// Print the information tag at the error level. Generally, the tag is the current class name.

Log. e ("aa", "dsdfsf ");

// Print warning level information

Log. w ("aa", "dsdfsf ");

// Print information-level information

Log. I ("aa", "dsdfsf ");

// Print debugging level information

Log. d ("aa", "dsdfsf ");

// Print the redundancy level information

Log. v ("aa", "dsdfsf ");

After running an application with log information, the system will create a filter containing all log information of the application. The name of the filter is the package name of the application. However, there may be bugs, and sometimes some information cannot be filtered out.

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.