TP-67450 | Sohan Reddy | Fix for metrics interceptor response logging (#11311)

This commit is contained in:
Sohan Reddy Atukula
2024-06-13 15:05:56 +05:30
committed by GitHub
parent 83e50a7fe9
commit bab30a4108

View File

@@ -20,6 +20,7 @@ import com.navi.common.utils.Constants
import com.navi.common.utils.getAnnotation
import com.navi.naviwidgets.utils.VERTICAL
import java.io.IOException
import live.hms.video.utils.toJson
import okhttp3.Interceptor
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.Protocol
@@ -90,7 +91,7 @@ class MetricInterceptor : Interceptor {
map[Constants.REQUEST_BODY] = requestBody
}
if (shouldEnableResponseLogging != null) {
map[Constants.RESPONSE] = response.body.toString()
map[Constants.RESPONSE] = response.body?.string().toJson()
}
NaviTrackEvent.trackEventOnClickStream(