Skip to content

Commit 9b0d22f

Browse files
committed
Avoid crash for long logs.
1 parent 1d08018 commit 9b0d22f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/interceptors/FormattedJsonHttpLogger.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ internal class FormattedJsonHttpLogger(
3838
*/
3939
@Synchronized
4040
override fun log(message: String) {
41-
Timber.v(message)
41+
Timber.v(message.take(20_000))
42+
if (message.length > 20_000) return
4243

4344
// Try to log formatted Json only if there is a chance that [message] contains Json.
4445
// It can be only the case if we log the bodies of Http requests.

0 commit comments

Comments
 (0)