Ren*_*ndy 1 eclipse android logcat android-logcat
任何人都知道为什么Logcat没有显示完整的消息?我尝试从我的网站打印xml响应,但我只能得到一些..
因为您的logcat已达到其最大大小,请参阅Logcat的大小限制以及如何更改其容量?
尝试使用此代码将结果写入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();
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2649 次 |
| 最近记录: |