android - 为什么 LogCat 不显示完整消息?

标签 android eclipse logcat android-logcat

有人知道为什么 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/

相关文章:

java - 带有 TestNG 插件和多个 eclipse 项目的 EclEmma 插件

android - 如何在 Android 手机上测试 Android 应用程序并获取错误日志?

java - Android 如何确定将哪个缓冲区用于 logcat 消息?

android - Logcat 在 AVD 上显示信息 3 次

android - QuickQ 新手 : Admob, 我必须删除测试设备 ID 还是无所谓?

android - 我需要在调用 dispose() 之前检查 isDisposed() 吗?

java - Selenium 2 WebDriver 找不到链接

android - 在 Android 中的特定区域上绘画

android - 在 android 应用程序中使用 sqlite 管理器

c - GDB 在 Eclipse 中的 longjmp 上崩溃