Only do http logging if a debug build is run (#1795)

This commit is contained in:
Josephine Lim 2018-08-05 01:43:10 +10:00 committed by Vivek Maskara
parent d29aa2e2e5
commit ff9f43ef8b

View file

@ -94,7 +94,9 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry); ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry);
params.setParameter(CoreProtocolPNames.USER_AGENT, getUserAgent()); params.setParameter(CoreProtocolPNames.USER_AGENT, getUserAgent());
httpClient = new DefaultHttpClient(cm, params); httpClient = new DefaultHttpClient(cm, params);
httpClient.addRequestInterceptor(NetworkInterceptors.getHttpRequestInterceptor()); if (BuildConfig.DEBUG) {
httpClient.addRequestInterceptor(NetworkInterceptors.getHttpRequestInterceptor());
}
api = new MWApi(apiURL, httpClient); api = new MWApi(apiURL, httpClient);
wikidataApi = new MWApi(wikidatApiURL, httpClient); wikidataApi = new MWApi(wikidatApiURL, httpClient);
this.defaultPreferences = defaultPreferences; this.defaultPreferences = defaultPreferences;