adb logcat: Increase the maximal message length

2019-02-24 06:09发布

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

2条回答
手持菜刀,她持情操
2楼-- · 2019-02-24 07:00

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

查看更多
The star\"
3楼-- · 2019-02-24 07:00

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

查看更多
登录 后发表回答