8
기본적으로 Log on android 플랫폼에는 콘솔 출력에 제한된 문자가 있습니다. 따라서 3000보다 약간 큰 메시지입니다. 따라서 메시지가 3000자를 초과하면 화면에 표시되지 않습니다.android에서 콘솔 출력을 늘리는 방법 Log class
public class Log {
private static int mode = android.util.Log.INFO;
public static void e(String tag, String msg, Throwable tr) {
if ((mode & android.util.Log.ERROR) <= 0) return;
android.util.Log.e(tag, msg, tr);
}
public static void e(String tag, String msg) {
if ((mode & android.util.Log.ERROR) <= 0) return;
android.util.Log.e(tag, msg);
}
public static void w(String tag, String msg) {
if ((mode & android.util.Log.WARN) <= 0) return;
android.util.Log.w(tag, msg);
}
public static void i(String tag, String msg) {
if ((mode & android.util.Log.INFO) <= 0) return;
android.util.Log.i(tag, msg);
}
public static void d(String tag, String msg) {
if ((mode & android.util.Log.DEBUG) <= 0) return;
int length = msg.length();
int kind = 3000;
if (length >= kind) {
int count = length/kind;
int u = length % kind;
int i = 0;
for (i = 0; i < count; ++i) {
int start = i * kind;
int end = start + kind;
android.util.Log.d(tag, msg.substring(start, end));
}
if (u != 0) {
int start = length - u;
int end = start + u;
android.util.Log.d(tag, msg.substring(start, end));
}
} else {
android.util.Log.d(tag, msg);
}
}
}
이 문제에 더 나은 솔루션이 있습니까 :
는나는이보다 더 나은 해결책을 발견하지?
무엇을하려하십니까? – Vinay
로그 출력 텍스트를 줄 바꿈하려고합니까? – Marcovena
아니요, 기본 로그 온 안드로이드 플랫폼에는 콘솔 출력에 제한된 문자가 있습니다. 따라서 3000보다 약간 큰 메시지입니다. 따라서 메시지가 3000자를 초과하면 화면에 표시되지 않습니다. –