Forráskód Böngészése

Merge branch 'develop' of https://github.com/swict/LifePlusAndroid into develop

Hasemi 7 éve
szülő
commit
61eb584dc8

+ 25 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/model/module/APIModule.java

@@ -38,7 +38,7 @@ public abstract class APIModule<T extends RequestBean, R extends LifeplusAPIBean
 
     @Override
     public void accept(R resultBean) throws Exception {
-      Log.i("APP# APIModule | accept", "| " + APIModule.this.getClass().getSimpleName() + " <- " + resultBean.toJson());
+      trace(resultBean.toJson());
       if (resultBean.isSuccess()) {
         listener.onApiSuccess(resultBean);
       }
@@ -46,6 +46,30 @@ public abstract class APIModule<T extends RequestBean, R extends LifeplusAPIBean
         listener.onApiReason(resultBean);
       }
     }
+
+  }
+
+  private void trace(String str) {
+
+    int limit = 3000;
+    if (str.length() > limit) {
+      Log.d("APP# APIModule | trace", "| " + APIModule.this.getClass().getSimpleName() + " <- length = " + str.length());
+      int chunkCount = str.length() / limit;     // integer division
+      for (int i = 0; i <= chunkCount; i++) {
+        int max = limit * (i + 1);
+        if (max >= str.length()) {
+          Log.d("APP# APIModule | trace", "| <- " + str.substring(limit * i));
+        }
+        else {
+          Log.d("APP# APIModule | trace", "| <- " + str.substring(limit * i, max));
+        }
+      }
+    }
+    else {
+      Log.i("APP# APIModule | accept", "| " + APIModule.this.getClass().getSimpleName() + " <- " + str);
+    }
+
+    // http://stackoverflow.com/questions/8888654/android-set-max-length-of-logcat-messages
   }
 
   // error

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1406
app/src/sandbox/java/kr/co/zumo/app/lifeplus/network/api/LifeplusAPIService.java