Windows environment Android Studio V1.2.2 Series 5-Log debugging

Source: Internet
Author: User

1. CustomizationLogcatDebug Log Font Color

Logcat is one of the most commonly used tools for Android development debugging, and the default color for Logcat debugging is already differentiated in Android Studio 1.2.2, but if you want to customize the font color for your debug logs to better differentiate verbose, Debug, error, info, warning and other classified information, then see how to customize the Logcat information.

    via menu file-->setting-->editor->colors & fonts->android logcat Enter, because we have set the mydarcula Scheme, so will see to the following interface:

Here you can see 6 debug levels: Assert, Debug, Error, Info, Verbose, warning.

Note that you need to remove the right use inherited attributes option before you can customize the color, and then double-click the right foregound icon to set a specific color for each category:

After selecting a good color, the text changes immediately below the debug level , which is very intuitive.

2. Logcat Filter Options

In the 6th part of [3], the first time you met Logcat, take a closer look at how to use Logcat to quickly find the log information you care about:

You can see the Logcat dialog window on the left, and you can see the log level filtering option, the Search filter input box, and the Filter configuration option in the upper right.

With the edit filter Configuration, the Create New Logcat Filter window appears, where you can set one or more options to filter the log and specify a filter Name for this set of filter parameters:

. Log TAG that can be written by regular

. log Message that can be written in regular

. Package Name

. Pid

. Log level

Here we set two filters according to the tag and level, respectively named Firstactivity and secondactivity:

Once setup is complete, you can see the set of two filters in the right drop-down list : Firstactivity and Secondactivity.

3. Output log information in code

To be continued

4. Running the application in debugger mode

Cond


Resources:

[1] Android Studio use tips: Custom Logcat, http://www.jb51.net/article/65515.htm

[2] Windows environment Android Studio V1.2.2 Series 3-Simple setup. http://my.oschina.net/1pei/blog/469674

[3] Windows environment Android Studio V1.2.2 Series 4-Interface Introduction, http://my.oschina.net/1pei/blog/469845

[4] Debugging with Android Studio, https://developer.android.com/intl/zh-cn/tools/debugging/debugging-studio.html

Windows environment Android Studio V1.2.2 Series 5-Log debugging

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.