Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
16b232d2
Commit
16b232d2
authored
Jun 07, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable okhttp logging in debug only
parent
3f3b1f5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
NetworkingModule.kt
...src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt
+9
-5
No files found.
app/src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt
View file @
16b232d2
...
@@ -2,6 +2,7 @@ package com.topjohnwu.magisk.di
...
@@ -2,6 +2,7 @@ package com.topjohnwu.magisk.di
import
com.squareup.moshi.JsonAdapter
import
com.squareup.moshi.JsonAdapter
import
com.squareup.moshi.Moshi
import
com.squareup.moshi.Moshi
import
com.topjohnwu.magisk.BuildConfig
import
com.topjohnwu.magisk.Constants
import
com.topjohnwu.magisk.Constants
import
com.topjohnwu.magisk.data.network.GithubRawApiServices
import
com.topjohnwu.magisk.data.network.GithubRawApiServices
import
okhttp3.OkHttpClient
import
okhttp3.OkHttpClient
...
@@ -23,13 +24,16 @@ val networkingModule = module {
...
@@ -23,13 +24,16 @@ val networkingModule = module {
}
}
fun
createOkHttpClient
():
OkHttpClient
{
fun
createOkHttpClient
():
OkHttpClient
{
val
httpLoggingInterceptor
=
HttpLoggingInterceptor
().
apply
{
val
builder
=
OkHttpClient
.
Builder
()
level
=
HttpLoggingInterceptor
.
Level
.
BODY
if
(
BuildConfig
.
DEBUG
)
{
val
httpLoggingInterceptor
=
HttpLoggingInterceptor
().
apply
{
level
=
HttpLoggingInterceptor
.
Level
.
BODY
}
builder
.
addInterceptor
(
httpLoggingInterceptor
)
}
}
return
OkHttpClient
.
Builder
()
return
builder
.
build
()
.
addInterceptor
(
httpLoggingInterceptor
)
.
build
()
}
}
fun
createConverterFactory
():
Converter
.
Factory
{
fun
createConverterFactory
():
Converter
.
Factory
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment