About Android log output & logcat

Source: Internet
Author: User

Android provides its own log output API --> In the Android. util. Log class.
There are five common log printing methods in this class. These five methods print logs to logcat:
Log. V (TAG, message); // verbose mode, print the most detailed log
Log. D (TAG, message); // debug-level log
Log. I (TAG, message); // info-level log
Log. W (TAG, message); // warn-level log
Log. E (TAG, message); // error-level log
The tag and message are two string values respectively. From the android development help document, the tag and message definitions are as follows:
Tag used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.
MSG the message you wowould like logged.
It can be seen that the tag is used to mark the source of the log message, while the message is the content of this log.
The number of log outputs is counted as: error, warn, info, debug, verbose. The number ranges from small to large.
I changed each method in the previous activity and added log. V to each method to record the log output. The result is as follows.

We can see that the on ** methods that previously called the log. V function are executed and the log is printed.

Related Article

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.