显示更多弦上的logcat [英] Displaying More string on Logcat

查看:112
本文介绍了显示更多弦上的logcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用JSON从服务器响应的Andr​​oid应用程序。 通常我工作的JSON响应。但现在我有一个的logcat问题, 如果JSON响应字符串很长,超过x字符(我不知道到底有多少是可以通过logcat中显示的最大字符串),一些JSON字符串的缺失。

I am currently working on an android App that uses 'JSON' as response from server. Usually I work on the JSON response. But now I have a problem with logcat, if the JSON response string is very long , more than x character (i don't know exactly how much is the max string that could be displayed by logcat), some of the JSON string is missing.

虽然它仍可以给我的输出,我需要对从服务器发送来的JSON字符串的信息。

Although it still could give me the output, I need the information on the JSON string that is transmitted from the server.

有没有显示在logcat的多个字符串的任何可能性?像增加缓冲或者说我可以用它来增加最大字符串长度,可以通过logcat中显示的任何参数。

Is there any possibility to display more string on logcat? Like increasing the buffer or any parameter that I could use to increase the maximum string length that could be displayed by logcat.

推荐答案

丑陋,但它的工作:

public static void longInfo(String str) {
    if(str.length() > 4000) {
        Log.i(TAG, str.substring(0, 4000));
        longInfo(str.substring(4000));
    } else
        Log.i(TAG, str);
}

这篇关于显示更多弦上的logcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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