有人知道为什么 Logcat 不显示完整消息吗? 我尝试从我的站点打印 xml 响应,但我只能得到其中的一部分..
最佳答案
因为您的 logcat 已达到其最大大小,请参阅 What is the size limit for Logcat and how to change its capacity?
尝试使用此代码将结果写入 sdcard 中的文本文件,然后使用 DDMS得到它。
public static void appendLog(String text)
{
File logFile = new File("sdcard/log.txt");
if (!logFile.exists())
{
try
{
logFile.createNewFile();
} catch (IOException e)
{
e.printStackTrace();
}
}
try
{
// BufferedWriter for performance, true to set append to file flag
BufferedWriter buf = new BufferedWriter(new FileWriter(logFile, true));
buf.append(text);
buf.newLine();
buf.close();
} catch (IOException e)
{
e.printStackTrace();
}
}
关于android - 为什么 LogCat 不显示完整消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11772657/