use of com.squareup.okhttp.logging.HttpLoggingInterceptor in project FloatingSearchView by renaudcerrato.
the class RetrofitModule method provideHttpClient.
@Provides
@Singleton
OkHttpClient provideHttpClient() {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient httpClient = new OkHttpClient();
httpClient.interceptors().add(logging);
return httpClient;
}
use of com.squareup.okhttp.logging.HttpLoggingInterceptor in project java by kubernetes-client.
the class ApiClient method setDebugging.
/**
* Enable/disable debugging for this API client.
*
* @param debugging To enable (true) or disable (false) debugging
* @return ApiClient
*/
public ApiClient setDebugging(boolean debugging) {
if (debugging != this.debugging) {
if (debugging) {
loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(Level.BODY);
httpClient.interceptors().add(loggingInterceptor);
} else {
httpClient.interceptors().remove(loggingInterceptor);
loggingInterceptor = null;
}
}
this.debugging = debugging;
return this;
}
Aggregations