为什么LogCat中不显示完整的邮件? [英] Why does LogCat not show the full message?

查看:95
本文介绍了为什么LogCat中不显示完整的邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道为什么LogCat中不显示完整的邮件? 我尝试打印从我的网站的XML响应,但我只可以得到一些吧。

Anyone knows why Logcat doesn't show full message? I try to print xml response from my site but I only can get some of it..

推荐答案

由于您的logcat已达到其最大尺寸,看的什么是大小限制的logcat?
尝试使用这种code来写你的结果到SD卡中,然后使用 DDMS 到一个文本文件明白这一点。

Because your logcat has reached its max size, see What is the size limit for Logcat?
Try using this code to write your result into a text file in sdcard, then use DDMS to get it.

 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();
    }
}

这篇关于为什么LogCat中不显示完整的邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆