adb logcat: Increase the maximal message length

走远了吗. 提交于 2019-12-20 01:33:39

问题


it seems like logcat truncates very long log messages, is there a way to prevent this?

$ adb logcat -g
ring buffer is 64Kb (63Kb consumed), max entry is 20480b, max payload is 20460b

I think I need to increase the max entry and/or may payload size!?

Kind regards Alex


回答1:


max entry and max payload are harcoded as below. So i dont think you can change them.

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




回答2:


Maybe you can create a custom class, which to you send your logmessages, which then divides them into multiple messages. like:

MyLogger.d("LOG_TAG",veryLongMessage);  

This class then just could check the size of the message, and split it up if nessecary, and then pass them into Log.d().



来源:https://stackoverflow.com/questions/8773606/adb-logcat-increase-the-maximal-message-length

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!