1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-23 11:21:29 +00:00

Log API requests as verbose, not warning.

This commit is contained in:
Felix Ableitner 2015-05-17 23:03:45 +02:00
parent 1e2c4196a8
commit 91bd271302
2 changed files with 5 additions and 3 deletions

View file

@ -56,9 +56,11 @@ public class GetTask extends AsyncTask<String, Void, String> {
*/ */
@Override @Override
protected String doInBackground(String... params) { protected String doInBackground(String... params) {
String fullUri = params[0] + params[1];
Log.v(TAG, "Calling Rest API at " + fullUri);
// Retry at most 10 times before failing // Retry at most 10 times before failing
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
String fullUri = params[0] + params[1];
HttpClient httpclient = Https.createHttpsClient(mHttpsCertPath); HttpClient httpclient = Https.createHttpsClient(mHttpsCertPath);
if (params.length == 5) { if (params.length == 5) {
LinkedList<NameValuePair> urlParams = new LinkedList<>(); LinkedList<NameValuePair> urlParams = new LinkedList<>();
@ -72,8 +74,6 @@ public class GetTask extends AsyncTask<String, Void, String> {
return null; return null;
try { try {
Log.w(TAG, "Calling Rest API at " + fullUri);
HttpResponse response = httpclient.execute(get); HttpResponse response = httpclient.execute(get);
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();

View file

@ -39,6 +39,8 @@ public class PostTask extends AsyncTask<String, Void, Boolean> {
@Override @Override
protected Boolean doInBackground(String... params) { protected Boolean doInBackground(String... params) {
String fullUri = params[0] + params[1]; String fullUri = params[0] + params[1];
Log.v(TAG, "Calling Rest API at " + fullUri);
HttpClient httpclient = Https.createHttpsClient(mHttpsCertPath); HttpClient httpclient = Https.createHttpsClient(mHttpsCertPath);
HttpPost post = new HttpPost(fullUri); HttpPost post = new HttpPost(fullUri);
post.addHeader(new BasicHeader(RestApi.HEADER_API_KEY, params[2])); post.addHeader(new BasicHeader(RestApi.HEADER_API_KEY, params[2]));