protected synchronized OkHttpClient getOkHttpClient ( ) { if ( okHttpClient == null ) { if ( isEnableDebug ( ) ) { HttpLoggingInterceptor logging = new HttpLoggingInterceptor ( ) ; logging . setLevel ( HttpLoggingInterceptor . Level . BASIC ) ; OkHttpClient . Builder httpClient = new OkHttpClient . Builder ( ) ; httpClient . addInterceptor ( logging ) ; okHttpClient = httpClient . build ( ) ; } else { okHttpClient = new OkHttpClient ( ) ; } } return okHttpClient ; }
Used Internally .