I am trying to display long message on logcat. If the length of message is more than 1000 characters, it gets broken.
What is the mechanism to show all characters of long message in logcat?
See Question&Answers more detail:osI am trying to display long message on logcat. If the length of message is more than 1000 characters, it gets broken.
What is the mechanism to show all characters of long message in logcat?
See Question&Answers more detail:osIf logcat is capping the length at 1000 then you can split the string you want to log with String.subString() and log it in pieces. For example:
int maxLogSize = 1000;
for(int i = 0; i <= veryLongString.length() / maxLogSize; i++) {
int start = i * maxLogSize;
int end = (i+1) * maxLogSize;
end = end > veryLongString.length() ? veryLongString.length() : end;
Log.v(TAG, veryLongString.substring(start, end));
}