Prechádzať zdrojové kódy

1.修改Android Apex Driver Network记录日志文件。

Pen Li 7 rokov pred
rodič
commit
0f43b35652

+ 4 - 0
ApexDrivers/RAUtilsLibrary/src/main/java/com/usai/redant/rautils/utils/Network.java

@@ -118,6 +118,10 @@ public class Network {
             os.close();
 
             // 获取返回数据
+            int responseCode = connection.getResponseCode();
+
+            Log.i(TAG, "getJson: " + "Request " + url + "Get Response Code" + responseCode);
+            
             if(connection.getResponseCode() == 200){
                 InputStream is = connection.getInputStream();
 

+ 9 - 0
ApexDrivers/apexdriverslib/src/main/java/com/usai/redant/apexdrivers/network/Network.java

@@ -11,6 +11,7 @@ import android.text.TextUtils;
 import com.usai.redant.apexdrivers.ApexDriverApplication;
 import com.usai.redant.apexdrivers.offline.OfflineHandler;
 import com.usai.redant.rautils.utils.RAUtil;
+import com.usai.redant.rautils.utils.dbgUtil;
 
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -102,10 +103,18 @@ public class Network extends com.usai.redant.rautils.utils.Network {
     }
 
     public static String getJson(String url, Bundle parms) {
+
+        dbgUtil.fileLog(ApexDriverApplication.sharedApplication(), "getJson(String url, Bundle parms) params " + parms.toString());
+        dbgUtil.fileLog(ApexDriverApplication.sharedApplication(), "getJson(String url, Bundle parms) network available:" + (NetworkIsAvailable(ApexDriverApplication.sharedApplication())));
+
         return getJson(url,parms, com.usai.redant.rautils.utils.Network.SO_TIMEOUT);
     }
 
     public static String getJSON(String url, Bundle params, int timeout) {
+
+        dbgUtil.fileLog(ApexDriverApplication.sharedApplication(), "getJSON(String url, Bundle params, int timeout) params " + params.toString());
+        dbgUtil.fileLog(ApexDriverApplication.sharedApplication(), "getJSON(String url, Bundle params, int timeout) network available:" + (NetworkIsAvailable(ApexDriverApplication.sharedApplication())));
+
         return getJson(url,params,timeout);
     }