1. API Highlights:
this API can be achieved without replacing APK , you can catch an effective device directly on the wrong phone . Log , can improve a lot of efficiency.
2 , API Introduction
recently, when solving the SMS problem, I saw a very powerful LOG Switch ---log.isloggable
1. if (log.isloggable (logtag.transaction, log.verbose)) {
2. log.v (TAG, "Creating transactionservice");
3. }
EnterFrameworkView inisloggableThe definition of the method, found that this is a use of theJNIthe method. However, there are many comments on the method declaration. Carefully looked down and found that it wasAndroida present for everyone.
The original meaning: check the currentTagis specified in theLoglevel. The general defaultLoglevel isINFO, which means that this includesINFOof theLogwill be output. You can modify the default by setting the System PropertiesLoglevel, execute the following command:
1. setprop Log.tag.; your_log_tag>; Level
You can also write this code in Local.prop file, and put the file in the /data/local.prop . According to the instructions above, try to execute the following command:
1. adb shell SetProp log.tag.Mms:transaction VERBOSE
then sent a MMS test, effective Log have been lost.
We're doing some digging on this basis to see What surprises Google has left us with. From the logtag.transaction in the second code above , you can see that there is a logtag.java file in the Mms package. Found that there are quite a number of constants declared:
1. public static final String TRANSACTION = "Mms: Transaction ";
2. public static final String APP = "Mms:app";
3. public static final String thread_cache = "Mms:threadcache" ;
4. public static final String thumbnail_cache = "Mms: Thumbnailcache ";
5. public static final String pdu_cache = "Mms:pducache";
6. public static final String WIDGET = "Mms:widget";
7. public static final String contact = "Mms:contact" ;
This is all a multimedia message inside the important Log switch. Know these after debugging MMS is more convenient, do not change the APK, in the problem of the phone directly can catch the effective log, can improve a lot of work efficiency. Let's take a look at where isloggable (stringtag, int level) has been called, and found that in addition to the framework layer and Mms applications, as well as Contacts and other important modules have been called, and later debugging these modules will be much easier.
Android: Share a very powerful Log switch---log.isloggable