Use of the Android Log.isloggable method
The Android dynamic Control logcat Log switch is dynamically controlled via the Log.isloggable (Tag,level) method,
1. Add a log when adding a judgment,
String tag= "Volley";
Boolean isdbug=log.isloggable (TAG, log.verbose);
if (isdbug) {
LOG.W (TAG, "Log");
}
2. Control the log switch by setting the property value.
On PC,cmd-> directory point to Adb.exe (D:\android\adt-bundle-windows-x86-20131030\sdk \platform-tools)->adb Shell SetProp Log.tag.Volley VERBOSE Sets the output level of this tag to VERBOSE. Then log.isloggable ("Volley", log.verbose) level for more than VERBOSE return True, each set once, can only be used for a phone does not restart the situation, if a change or restart to reset it; Self-developed mobile phone set up once, can print verbose, compiled to other mobile phones can not print verbose information, so that you do not have to set the Isdbug to false each time the official release
The value order of the property value is "V,d,i,w,e,a,s" A for the highest level of the log, that is, assert;s represents suppress, which stops the output of the log.
You can also add this property to the Data/local.prop property file, but the difference is that the phone restarts or not, as long as there is local.prop, to print verbose
Log Console print settings