Logcat View Android Run log

Source: Internet
Author: User

The Android log system provides the ability to record and view system debug information.

The Android log information has a tag and output level. The output level from low to high can be divided into several levels:

V (Verbose)

D (Debug)

I (Info)

W (Warn)

E (Error)

F (Fatal)

S (Silent)

When using eclipse development, we can easily use the DDMS logcat tool to easily view log information

During the code debugging process we can also use the Logcat tool to facilitate debugging code, the program we can actively write to the Android logbook, and through the filter to quickly find out if there are no error alerts appear. Let's take a brief introduction to an example.

Create a project and add the following code to the Mainactivity Oncreat method

@Overrideprotected void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Setcontentview ( R.layout.activity_main);                 Add a log message log.i ("TAG", "This piece of information, located in the text position");}    

Click the green plus sign at the Logcat toolbar

Displays the following information

Filter Name: Filters names

By Log tag: Search by tag

By log message: Find log information with input information by fuzzy matching of log-related information

By PID: Filter By Application ID

By Application Name: match the output log application

By log levels: All information at the log information level above the selected level (including the selected level).

Several filtering information for the relationship with the more filtering information to find more accurate.

We enter the following information, indicating that the filter name is 1, the search label (tag) is tag, the output information contains text.

The results are as follows

If we modify the by Log message content as follows

The results are as follows

Logcat view Android run log

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.