Android的 - logcat的消息设置最大长度 [英] Android - Set max length of logcat messages

查看:2902
本文介绍了Android的 - logcat的消息设置最大长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在默认情况下,似乎logcat的将截断它认为是太长任何日志信息。出现这种情况的Eclipse内外使用亚行-d logcat的在命令行上运行时的logcat,并截断了一些重要的调试信息。

By default, it seems that logcat will truncate any log message that it considers to be "too long". This happens both inside of Eclipse and when running logcat on the command line using adb -d logcat, and is truncating some important debugging messages.

有没有什么办法来增加最大字符串长度logcat的支持,以得到它停止截断的调试信息?该 意味着有可能不是正式文件,但也许logcat的支持一些额外的选项没有提到有?

Is there any way to increase the maximum string length supported by logcat to get it to stop truncating the debug information? The official documentation implies that there may not be, but maybe logcat supports some additional options not mentioned there?

推荐答案

有一个在logcat中的二进制日志(的/ dev /日志/事件)和一个固定大小的缓冲区此限制是1024字节。 对于非二进制日志也有一个限度:

There is a fixed size buffer in logcat for binary logs (/dev/log/events) and this limit is 1024 bytes. For the non-binary logs there is also a limit:

#define LOGGER_ENTRY_MAX_LEN        (4*1024)
#define LOGGER_ENTRY_MAX_PAYLOAD (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry))

因此​​,对于二进制和非二进制日志真正的邮件大小为〜4076字节。 内核记录器接口强行这个 LOGGER_ENTRY_MAX_PAYLOAD 限制。

So the real message size for both binary and non-binary logs is ~4076 bytes. The kernel logger interface imposes this LOGGER_ENTRY_MAX_PAYLOAD limit.

(通过logcat中使用)的liblog人士还称:

The liblog sources (used by logcat) also say:

      
  • 在可能已被截断内核日志驱动程序的消息。
  •   

我会建议你 nxlog 的工具,它不使用logcat的二进制文件,但由于内核中的局限性,所以我怀疑它会解决你的问题。然而,它可能是值得一试。 (免责声明:我的作者。)

I would recommend you the nxlog tool which does not use the logcat binary, but due to the limitations in the kernel I doubt that it will solve your problem. Nevertheless, it might be worth a try. (disclaimer: I'm the author.)

这篇关于Android的 - logcat的消息设置最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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