Why does LogCat not show the full message?

后端 未结 2 1188
野的像风
野的像风 2020-12-20 06:47

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..

相关标签:
2条回答
  • 2020-12-20 07:25

    put your cursor on the error ,you will see the full log-cat info.

    0 讨论(0)
  • 2020-12-20 07:29

    Because your logcat has reached its max size, see What is the size limit for Logcat and how to change its capacity?
    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();
        }
    }
    
    0 讨论(0)
提交回复
热议问题