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