Using the Log.isloggable method

Source: Internet
Author: User

In the audio debug process, you want to open the log in the Audioservice.java file, for example, to open the SetMode log:

if (debug_mode) {log.v (TAG, "SetMode (mode=" + MODE + ")");}

This side encounters a debug_mode switch, which is defined as:

private static final String TAG = "Audioservice";

Protected static Final Boolean Debug_mode = log.isloggable(TAG + ". MOD ", log.debug);

From the definition, you need to tag + ". MOD "is defined as Log.debug to open this log switch.

Implementation method:

Method 1:

$ADB Shell SetProp Log.tag.AudioService.MOD DEBUG

This method is only one-time, that is, after restarting the machine, the property Log.tag.AudioService.MOD value becomes null and needs to be reconfigured. Another point to note is that after you set the property by SetProp, you also need to restart the framework so that the system can recognize that the property has been reconfigured.

command to restart the framework: $ADB shell stop && $adb Shell start

Method 2:

#echo log.tag.audioservice.mod=debug >/data/local.prop

#chmod 644/data/local.prop

#reboot

The method is permanent, and after restarting the machine, the property value remains unchanged, without reconfiguring.

Using the Log.isloggable method

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.