1
0
mirror of https://github.com/vector-im/riotX-android synced 2025-10-06 00:02:48 +02:00

Avoid crash for long logs.

This commit is contained in:
Benoit Marty
2025-07-15 11:14:51 +02:00
parent 1d08018e20
commit 9b0d22f83f

View File

@@ -38,7 +38,8 @@ internal class FormattedJsonHttpLogger(
*/
@Synchronized
override fun log(message: String) {
Timber.v(message)
Timber.v(message.take(20_000))
if (message.length > 20_000) return
// Try to log formatted Json only if there is a chance that [message] contains Json.
// It can be only the case if we log the bodies of Http requests.