mirror of
https://github.com/bitwarden/android.git
synced 2025-02-16 20:09:59 +03:00
Ensure all data from network logger makes it into the logs (#1062)
This commit is contained in:
parent
3febae577a
commit
4c7c82b5d0
1 changed files with 7 additions and 1 deletions
|
@ -15,6 +15,8 @@ import okhttp3.OkHttpClient
|
|||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
import retrofit2.Retrofit
|
||||
|
||||
private const val MAX_LOG_MESSAGE_LENGTH: Int = 4000
|
||||
|
||||
/**
|
||||
* Primary implementation of [Retrofits].
|
||||
*/
|
||||
|
@ -67,7 +69,11 @@ class RetrofitsImpl(
|
|||
|
||||
//region Helper properties and functions
|
||||
private val loggingInterceptor: HttpLoggingInterceptor by lazy {
|
||||
HttpLoggingInterceptor { Log.d("BitwardenNetworkClient", it) }
|
||||
HttpLoggingInterceptor { message ->
|
||||
message.chunked(size = MAX_LOG_MESSAGE_LENGTH).forEach { chunk ->
|
||||
Log.d("BitwardenNetworkClient", chunk)
|
||||
}
|
||||
}
|
||||
.apply {
|
||||
setLevel(
|
||||
if (BuildConfig.DEBUG) {
|
||||
|
|
Loading…
Add table
Reference in a new issue