mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Ensure big log does not crash the application
This commit is contained in:
committed by
Benoit Marty
parent
a234f010a0
commit
a448b417f7
+2
-1
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package io.element.android.libraries.network.interceptors
|
package io.element.android.libraries.network.interceptors
|
||||||
|
|
||||||
|
import io.element.android.libraries.core.extensions.ellipsize
|
||||||
import okhttp3.logging.HttpLoggingInterceptor
|
import okhttp3.logging.HttpLoggingInterceptor
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import org.json.JSONException
|
import org.json.JSONException
|
||||||
@@ -28,7 +29,7 @@ internal class FormattedJsonHttpLogger(
|
|||||||
*/
|
*/
|
||||||
@Synchronized
|
@Synchronized
|
||||||
override fun log(message: String) {
|
override fun log(message: String) {
|
||||||
Timber.v(message)
|
Timber.v(message.ellipsize(200_000))
|
||||||
|
|
||||||
// Try to log formatted Json only if there is a chance that [message] contains Json.
|
// 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.
|
// It can be only the case if we log the bodies of Http requests.
|
||||||
|
|||||||
Reference in New Issue
Block a user