Skip to content

Instantly share code, notes, and snippets.

@AkshayMoorthy
Last active April 26, 2018 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkshayMoorthy/001f60f9857e8e52d0ab21176eeb6ae2 to your computer and use it in GitHub Desktop.
Save AkshayMoorthy/001f60f9857e8e52d0ab21176eeb6ae2 to your computer and use it in GitHub Desktop.
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
// set your desired log level
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
// add logging as last interceptor
clientBuilder.addInterceptor(loggingInterceptor);
return new Retrofit.Builder().baseUrl(ROOT_URL)
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment