adb logcat: Increase the maximal message length

后端 未结 2 1564
小鲜肉
小鲜肉 2021-01-19 19:16

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 2048         


        
相关标签:
2条回答
  • 2021-01-19 19:58

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

    0 讨论(0)
  • 2021-01-19 20: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().

    0 讨论(0)
提交回复
热议问题