Java 类com.squareup.okhttp.logging.HttpLoggingInterceptor 实例源码

项目:AndroidTvBoilerplate    文件:AndroidTvBoilerplateService.java   
public static AndroidTvBoilerplateService newVineyardService() {
    OkHttpClient client = new OkHttpClient();
    client.interceptors().add(new Interceptor() {
        @Override
        public Response intercept(Chain chain) throws IOException {
            Response response = chain.proceed(chain.request());
            // Catch unauthorised error
            return response;
        }
    });

    HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
    interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.interceptors().add(interceptor);

    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(AndroidTvBoilerplateService.ENDPOINT)
            .client(client)
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .build();
    return retrofit.create(AndroidTvBoilerplateService.class);
}
项目:BaseWrapper    文件:RestClient.java   
/**
 * return Retrofit
 */
public Retrofit RestClient() {
  HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
  if (isDebug()) {
    logging.setLevel(logLevel());
  } else {
    logging.setLevel(Level.NONE);
  }

  OkHttpClient client = new OkHttpClient();
  client.interceptors().add(logging);
  client.interceptors().addAll(getInterceptors());

  return new Retrofit.Builder().baseUrl(baseURL())
      .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
      .addConverterFactory(getFactory())
      .client(client)
      .build();
}
项目:RoomBookerMVP    文件:NetworkModule.java   
@Provides
@PerApplication
Retrofit provideRetrofit() {
    String endpointUrl = BuildConfig.apiEndpointUrl;
    Gson gson = new GsonBuilder()
            .setDateFormat(API_DATE_FORMAT)
            .setFieldNamingPolicy(API_JSON_NAMING_POLICY)
            .registerTypeAdapter(ResponseWrapper.class, new ResponseDeserializer())
            .addSerializationExclusionStrategy(new JsonExclusionStrategy())
            .addDeserializationExclusionStrategy(new JsonExclusionStrategy())
            .create();
    GsonConverterFactory gsonConverterFactory = GsonConverterFactory.create(gson);
    OkHttpClient client = new OkHttpClient();
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
    logging.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.interceptors().add(logging);
    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(endpointUrl)
            .client(client)
            .addConverterFactory(gsonConverterFactory)
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .build();
    return retrofit;
}
项目:PictureInPicturePlayground    文件:AndroidTvBoilerplateService.java   
public static AndroidTvBoilerplateService newVineyardService() {
    OkHttpClient client = new OkHttpClient();
    client.interceptors().add(new Interceptor() {
        @Override
        public Response intercept(Chain chain) throws IOException {
            Response response = chain.proceed(chain.request());
            // Catch unauthorised error
            return response;
        }
    });

    HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
    interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.interceptors().add(interceptor);

    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(AndroidTvBoilerplateService.ENDPOINT)
            .client(client)
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .build();
    return retrofit.create(AndroidTvBoilerplateService.class);
}
项目:Mensageiro    文件:BaseNetworkConfig.java   
public static <S> S createService(Class<S> serviceClass) {

        //logging retrofit
        final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);

        final OkHttpClient okHttpClient = new OkHttpClient();
        okHttpClient.setConnectTimeout(TIMEOUT, TimeUnit.SECONDS);
        okHttpClient.setReadTimeout(TIMEOUT, TimeUnit.SECONDS);
        okHttpClient.setWriteTimeout(TIMEOUT, TimeUnit.SECONDS);
        okHttpClient.interceptors().add(interceptor);

        final Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .client(okHttpClient)
                .build();

        return retrofit.create(serviceClass);
    }
项目:ImageLoaders    文件:APIClient.java   
APIClient() {
    OkHttpClient client = new OkHttpClient();
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
    logging.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.interceptors().add(logging);
    client.setConnectTimeout(10, TimeUnit.SECONDS);
    client.setReadTimeout(10, TimeUnit.SECONDS);
    client.setWriteTimeout(10, TimeUnit.SECONDS);
    Retrofit retrofit = new Retrofit.Builder()
            .client(client)
            .baseUrl("http://gank.avosapps.com/api/")
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .addConverterFactory(GsonConverterFactory.create())
            .build();
    service = retrofit.create(MeizhiService.class);
}
项目:Rocket.Chat-android    文件:Meteor.java   
/**
 * Opens a connection to the server over websocket
 *
 * @param isReconnect whether this is a re-connect attempt or not
 */
public void openConnection(final boolean isReconnect) {

    if (isReconnect) {
        if (isConnected()) {
            connect(mSessionID);
            return;
        }
    }

    OkHttpClient client = new OkHttpClient();
    client.setConnectTimeout(1, TimeUnit.MINUTES);
    client.setReadTimeout(1, TimeUnit.MINUTES);
    client.setWriteTimeout(1, TimeUnit.MINUTES);
    HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
    loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
    client.networkInterceptors().add(loggingInterceptor);

    Request request = new Request.Builder()
            .url(mServerUri)
            .build();
    WebSocketCall.create(client, request).enqueue(mWebSocketObserver);
}
项目:xDrip-Experimental    文件:NsRestApiReader.java   
private INsRestApi CreateNsMethods(String baseUrl) {
    Retrofit retrofit;

    HttpLoggingInterceptor logging = new HttpLoggingInterceptor();  
    // set your desired log level
    logging.setLevel(HttpLoggingInterceptor.Level.BODY);

    OkHttpClient httpClient = new OkHttpClient();  
    // add your other interceptors ...

    // add logging as last interceptor
    httpClient.interceptors().add(logging);  // <-- this is the important line for logging

    Gson gson = new GsonBuilder().create();
    retrofit = new Retrofit.Builder()
    .baseUrl(baseUrl)
    .addConverterFactory(GsonConverterFactory.create(gson))
    .client(httpClient)
    .build();

    return retrofit.create(INsRestApi.class);
}
项目:RoomBookerMVP    文件:NetworkModule.java   
@Provides
@PerApplication
Retrofit provideRetrofit() {
    String endpointUrl = BuildConfig.apiEndpointUrl;
    Gson gson = new GsonBuilder()
            .setDateFormat(API_DATE_FORMAT)
            .setFieldNamingPolicy(API_JSON_NAMING_POLICY)
            .registerTypeAdapter(ResponseWrapper.class, new ResponseDeserializer())
            .addSerializationExclusionStrategy(new JsonExclusionStrategy())
            .addDeserializationExclusionStrategy(new JsonExclusionStrategy())
            .create();
    GsonConverterFactory gsonConverterFactory = GsonConverterFactory.create(gson);
    OkHttpClient client = new OkHttpClient();
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
    logging.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.interceptors().add(logging);
    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(endpointUrl)
            .client(client)
            .addConverterFactory(gsonConverterFactory)
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .build();
    return retrofit;
}
项目:VerseOfTheDay    文件:BibleGatewayApiController.java   
public static BibleGatewayService instance(@NonNull Context context) {
    if (sService == null) {
        final Cache cache = new Cache(new File(context.getCacheDir(), HTTP_CACHE_FILE_NAME),
                HTTP_CACHE_SIZE);

        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);

        final OkHttpClient okHttpClient = new OkHttpClient();
        okHttpClient.setConnectTimeout(30, TimeUnit.SECONDS);
        okHttpClient.setReadTimeout(30, TimeUnit.SECONDS);
        okHttpClient.setCache(cache);
        okHttpClient.interceptors().add(interceptor);

        Retrofit retrofit = new Retrofit.Builder().
                baseUrl(BibleGatewayService.API_BASE_URL).
                addConverterFactory(GsonConverterFactory.create()).
                addCallAdapterFactory(RxJavaCallAdapterFactory.create()).
                client(okHttpClient).
                build();

        sService = retrofit.create(BibleGatewayService.class);
    }
    return sService;
}
项目:Vineyard    文件:VineyardService.java   
public static VineyardService newVineyardService() {
    OkHttpClient client = new OkHttpClient();
    client.interceptors().add(new Interceptor() {
        @Override
        public Response intercept(Chain chain) throws IOException {
            Response response = chain.proceed(chain.request());
            // Catch unauthorised error
            return response;
        }
    });

    HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
    interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.interceptors().add(interceptor);

    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(VineyardService.ENDPOINT)
            .client(client)
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .build();
    return retrofit.create(VineyardService.class);
}
项目:ImageLoaders    文件:APIClient.java   
APIClient() {
    OkHttpClient client = new OkHttpClient();
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
    logging.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.interceptors().add(logging);
    client.setConnectTimeout(10, TimeUnit.SECONDS);
    client.setReadTimeout(10, TimeUnit.SECONDS);
    client.setWriteTimeout(10, TimeUnit.SECONDS);
    Retrofit retrofit = new Retrofit.Builder()
            .client(client)
            .baseUrl("http://gank.avosapps.com/api/")
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .addConverterFactory(GsonConverterFactory.create())
            .build();
    service = retrofit.create(MeizhiService.class);
}
项目:BuenosAiresAntesYDespues    文件:ApiConnection.java   
private void connectToApi() {
    HttpLoggingInterceptor.Level logLevel = HttpLoggingInterceptor.Level.BODY;
    HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
    interceptor.setLevel(logLevel);

    OkHttpClient okHttpClient = this.createClient();
    final Request request = new Request.Builder()
            .url(this.url)
            .addHeader(CONTENT_TYPE_LABEL, CONTENT_TYPE_VALUE_JSON)
            .get()
            .build();

    try {
        this.response = okHttpClient.newCall(request).execute().body().string();
    } catch (IOException e) {
        Log.e(this.getClass().getName(), "An error occured while trying to execute the HTTP call", e);
    }
}
项目:SimWatch    文件:SimWatchClient.java   
private SimWatchClient(Configuration configuration) {
    OkHttpClient client = new OkHttpClient();
    if (configuration.isRequestLoggingEnabled()) {
        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(
                new HttpLoggingInterceptor.Logger() {
                    @Override
                    public void log(String message) {
                        LOG.info(message);
                    }
                });
        interceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
        client.interceptors().add(interceptor);
    }

    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(configuration.getUrl())
            .client(client)
            .addConverterFactory(GsonConverterFactory.create(GsonUtil.getGson()))
            .build();
    backend = retrofit.create(BackendService.class);
}
项目:Vapor    文件:OkCloudAppModule.java   
@Provides
@Singleton
public OkHttpClient providesOkHttpClient(Context context) {
    OkHttpClient client = new OkHttpClient();
    HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
    interceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
    client.interceptors().add(interceptor);
    client.networkInterceptors().add(new StethoInterceptor());
    File httpCacheDir = new File(context.getCacheDir() + "/okhttp");
    httpCacheDir.mkdirs();
    cleanDir(httpCacheDir);
    long httpCacheSize = 50 * 1024 * 1024; // 50 MiB
    Cache cache = new Cache(httpCacheDir, httpCacheSize);
    client.setCache(cache);
    return client;
}
项目:afp-api-client    文件:ApiClient.java   
/**
 * 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;
}
项目:coner-core-client-java    文件:ApiClient.java   
/**
 * 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;
}
项目:nifi-swagger-client    文件:ApiClient.java   
/**
 * 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;
}
项目:swaggy-jenkins    文件:ApiClient.java   
/**
 * 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;
}
项目:moviegur    文件:NetworkModule.java   
@Provides
@Singleton
public OkHttpClient providesOkHttpClient(Application application) {
    OkHttpClient client = new OkHttpClient();
    client.setCache(new Cache(application.getCacheDir(), CACHE_SIZE));

    HttpLoggingInterceptor logger = new HttpLoggingInterceptor();
    logger.setLevel(BuildConfig.DEBUG ? HttpLoggingInterceptor.Level.HEADERS : HttpLoggingInterceptor.Level.NONE);
    client.interceptors().add(logger);

    return client;
}
项目:tradeshift-platform-sdk    文件:ApiClient.java   
/**
 * 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;
}
项目:Blockbuster    文件:ServiceFactory.java   
public static TMDBService newTMDBService(){
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
    logging.setLevel(HttpLoggingInterceptor.Level.BODY);
    OkHttpClient httpClient = new OkHttpClient();
    httpClient.interceptors().add(logging);

    Retrofit movieAPIRest = new Retrofit.Builder()
            .baseUrl(TMDBService.MOVIE_DB_HOST)
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .client(httpClient)
            .build();

    return movieAPIRest.create(TMDBService.class);
}
项目:nifi-api-client-java    文件:ApiClient.java   
/**
 * 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;
}
项目:okhttp-oauth    文件:TwitterIntegrationTest.java   
@Before
public void setUp() {
    twitter = new TwitterOAuth();

    myConsumer = new DefaultOAuthConsumer("vp3R3eeSvXcYAJLot3TJOE1SJ", "qqI5GFRqJCnHFiIaK10gyVqDhrvGftZFUNIfO7bWGiSvhIyoM0");

    OkHttpClient okHttpClient = new OkHttpClient();
    HttpLoggingInterceptor log = new HttpLoggingInterceptor();
    log.setLevel(HttpLoggingInterceptor.Level.BODY);
    okHttpClient.networkInterceptors().add(log);
    client = new OkHttpOAuthClient(okHttpClient, myConsumer, twitter, twitter);
}
项目:artikcloud-java    文件:ApiClient.java   
/**
 * 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;
}
项目:spree-android    文件:ApiClient.java   
public ApiClient() {
    Gson gson = new GsonBuilder()
            .setDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS'Z'")
            .enableComplexMapKeySerialization()
            .setPrettyPrinting()
            .create();

    OkHttpClient client = new OkHttpClient();
    HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
    loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.interceptors().add(loggingInterceptor);
    Retrofit retrofit = new Retrofit.Builder()
            .client(client)
            .baseUrl(Constants.BASE_API_URL)
            .addConverterFactory(GsonConverterFactory.create(gson))
            .build();


    apiService = retrofit.create(ApiService.class);


    Retrofit sessionRetrofit = new Retrofit.Builder()
            .baseUrl(Constants.BASE_API_URL)
            .addConverterFactory(GsonConverterFactory.create(gson))
            .client(createRequestInterceptorClient())
            .build();



    sessionApiService = sessionRetrofit.create(ApiService.class);
}
项目:FloatingSearchView    文件:RetrofitModule.java   
@Provides
@Singleton
OkHttpClient provideHttpClient() {
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
    logging.setLevel(HttpLoggingInterceptor.Level.BODY);
    OkHttpClient httpClient = new OkHttpClient();
    httpClient.interceptors().add(logging);
    return httpClient;
}
项目:CAS2016    文件:CASApiConfig.java   
private Retrofit createDefaultRetrofit(String baseUrl, boolean debug) {
    OkHttpClient client = new OkHttpClient();
    if (debug) {
        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        client.interceptors().add(interceptor);
    }

    Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl)
            .client(client)
            .addConverterFactory(GsonConverterFactory.create())
            .build();

    return retrofit;
}
项目:swagger-aem    文件:ApiClient.java   
/**
 * 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;
}
项目:ZhihuDailyRRD    文件:ClientApiModule.java   
@Provides
@Singleton
public HttpLoggingInterceptor providerLog(){
    HttpLoggingInterceptor interceptor=new HttpLoggingInterceptor();
    interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    return interceptor;
}
项目:ZhihuDailyRRD    文件:ClientApiModule.java   
@Provides
@Singleton
public OkHttpClient provideClient(HttpLoggingInterceptor interceptor){
    OkHttpClient client=new OkHttpClient();
    client.interceptors().add(providerLog());
    return client;
}
项目:Auth0.Android    文件:OkHttpClientFactoryTest.java   
private static void verifyLoggingEnabled(OkHttpClient client, List list) {
    verify(client).interceptors();

    ArgumentCaptor<Interceptor> interceptorCaptor = ArgumentCaptor.forClass(Interceptor.class);
    verify(list).add(interceptorCaptor.capture());

    assertThat(interceptorCaptor.getValue(), is(notNullValue()));
    assertThat(interceptorCaptor.getValue(), is(instanceOf(HttpLoggingInterceptor.class)));
    assertThat(((HttpLoggingInterceptor) interceptorCaptor.getValue()).getLevel(), is(HttpLoggingInterceptor.Level.BODY));
}
项目:codelibrary-java    文件:ApiClient.java   
/**
 * 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;
}
项目:crowdemotion-api-client-java    文件:ApiClient.java   
/**
 * 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;
}
项目:ariADDna    文件:ApiClient.java   
/**
 * 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;
}
项目:gitlab-android    文件:OkHttpProvider.java   
public static OkHttpClient getInstance(Account account){
    if(client==null){
        client = new OkHttpClient();
        client.setConnectTimeout(10, TimeUnit.SECONDS);
        client.interceptors().add(new HttpLoggingInterceptor(HttpLoggingInterceptor.Logger.DEFAULT));
        client.networkInterceptors().add(new AuthentificationInterceptor(account));
        client.interceptors().add(mErrorInterceptor);
    }
    return client;
}
项目:triglav-client-java    文件:ApiClient.java   
/**
 * 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;
}
项目:triglav-client-java    文件:ApiClient.java   
/**
 * 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;
}
项目:LIO-SDK-API-Integracao-Remota-v1-Java    文件:ApiClient.java   
/**
 * 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;
}
项目:tradeshift-app-samples    文件:ApiClient.java   
/**
 * 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;
}