Tweak network logging and json serializing

This commit is contained in:
Syer10
2021-06-06 16:54:50 -04:00
parent 4f248a65bb
commit d042bac708

View File

@@ -25,15 +25,18 @@ internal class HttpProvider @Inject constructor() : Provider<Http> {
install(JsonFeature) {
serializer = KotlinxSerializer(
Json {
if (!BuildConfig.DEBUG) {
ignoreUnknownKeys = true
}
isLenient = false
ignoreUnknownKeys = !BuildConfig.DEBUG
allowSpecialFloatingPointValues = true
useArrayPolymorphism = false
}
)
}
if (BuildConfig.DEBUG) {
install(Logging) {
level = LogLevel.HEADERS
install(Logging) {
level = if (BuildConfig.DEBUG) {
LogLevel.HEADERS
} else {
LogLevel.INFO
}
}
}