|
@@ -154,9 +154,12 @@ public final class Jlog {
|
|
|
if (!IS_SHOW_LOG) {
|
|
|
return;
|
|
|
}
|
|
|
- if (!IS_INIT && isApkInDebug()) {
|
|
|
+ if (!IS_INIT) {
|
|
|
return;
|
|
|
}
|
|
|
+// if (!IS_INIT && isApkInDebug()) {
|
|
|
+// return;
|
|
|
+// }
|
|
|
|
|
|
Throwable tr = new Throwable();
|
|
|
StringWriter sw = new StringWriter();
|
|
@@ -186,9 +189,12 @@ public final class Jlog {
|
|
|
if (!IS_SHOW_LOG) {
|
|
|
return;
|
|
|
}
|
|
|
- if (!IS_INIT && isApkInDebug()) {
|
|
|
+ if (!IS_INIT) {
|
|
|
return;
|
|
|
}
|
|
|
+// if (!IS_INIT && isApkInDebug()) {
|
|
|
+// return;
|
|
|
+// }
|
|
|
String[] contents = wrapperContent(STACK_TRACE_INDEX_5, tagStr, objects);
|
|
|
String tag = contents[0];
|
|
|
String msg = contents[1];
|
|
@@ -207,7 +213,7 @@ public final class Jlog {
|
|
|
JsonLog.printJson(tag, msg, headString);
|
|
|
break;
|
|
|
case XML:
|
|
|
-// XmlLog.printXml(tag, msg, headString);
|
|
|
+ XmlLog.printXml(tag, msg, headString);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -227,15 +233,18 @@ public final class Jlog {
|
|
|
if (!IS_SHOW_LOG) {
|
|
|
return;
|
|
|
}
|
|
|
- if (!IS_INIT && isApkInDebug()) {
|
|
|
+ if (!IS_INIT) {
|
|
|
return;
|
|
|
}
|
|
|
+// if (!IS_INIT && isApkInDebug()) {
|
|
|
+// return;
|
|
|
+// }
|
|
|
String[] contents = wrapperContent(STACK_TRACE_INDEX_5, tagStr, objectMsg);
|
|
|
String tag = contents[0];
|
|
|
String msg = contents[1];
|
|
|
String headString = contents[2];
|
|
|
|
|
|
-// FileLog.printFile(tag, targetDirectory, fileName, headString, msg);
|
|
|
+ FileLog.printFile(tag, targetDirectory, fileName, headString, msg);
|
|
|
}
|
|
|
|
|
|
private static String[] wrapperContent(int stackTraceIndex, Object tagStr, Object... objects) {
|
|
@@ -296,14 +305,13 @@ public final class Jlog {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static boolean isApkInDebug() {
|
|
|
+// private static boolean isApkInDebug() {
|
|
|
// try {
|
|
|
-// @SuppressLint("PrivateApi")
|
|
|
-// Application application = (Application) Class.forName("android.app.ActivityThread").getMethod("currentApplication").invoke(null, (Object[]) null);
|
|
|
-// ApplicationInfo info = application.getApplicationInfo();
|
|
|
-// return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0;
|
|
|
+//// Application application = (Application) Class.forName("android.app.ActivityThread").getMethod("currentApplication").invoke(null, (Object[]) null);
|
|
|
+//// ApplicationInfo info = application.getApplicationInfo();
|
|
|
+//// return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0;
|
|
|
// } catch (Exception e) {
|
|
|
- return false;
|
|
|
+// return false;
|
|
|
// }
|
|
|
- }
|
|
|
+// }
|
|
|
}
|