summaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/rest/src
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-08-28 22:16:36 +0000
committerGerrit Code Review <gerrit@onap.org>2017-08-28 22:16:36 +0000
commit5d7908a75107dcd18e7dd2f8a2d3e6528f5f830d (patch)
tree48f3fd34db7bf8ca5714474773d2a86cedce3a95 /controlloop/common/model-impl/rest/src
parent98d04b5c4e9aa3f7dd40cd40cbd1b00689b0bc22 (diff)
parent11e0afc41aa47b9b5fe36c6c654c5b7493e4ba46 (diff)
Merge "Removal of sys.out/err with logger messages"
Diffstat (limited to 'controlloop/common/model-impl/rest/src')
-rw-r--r--controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java b/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java
index c38c1076c..9ea480981 100644
--- a/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java
+++ b/controlloop/common/model-impl/rest/src/main/java/org/onap/policy/rest/RESTManager.java
@@ -55,14 +55,14 @@ public final class RESTManager {
CredentialsProvider credentials = new BasicCredentialsProvider();
credentials.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
- System.out.println("HTTP REQUEST: " + url + " -> " + username + ((password!=null)?password.length():"-") + " -> " + contentType);
+ logger.debug("HTTP REQUEST: {} -> {} {} -> {}", url, username, ((password!=null)?password.length():"-"), contentType);
if (headers != null) {
- System.out.println("Headers: ");
+ logger.debug("Headers: ");
headers.forEach((name, value) -> {
- System.out.println(name + " -> " + value);
+ logger.debug("{} -> {}", name, value);
});
}
- System.out.println(body);
+ logger.debug(body);
try (CloseableHttpClient client = HttpClientBuilder.create().setDefaultCredentialsProvider(credentials).build()) {
@@ -81,9 +81,9 @@ public final class RESTManager {
HttpResponse response = client.execute(post);
String returnBody = EntityUtils.toString(response.getEntity(), "UTF-8");
- System.out.println("HTTP POST Response Status Code: " + response.getStatusLine().getStatusCode());
- System.out.println("HTTP POST Response Body:");
- System.out.println(returnBody);
+ logger.debug("HTTP POST Response Status Code: {}", response.getStatusLine().getStatusCode());
+ logger.debug("HTTP POST Response Body:");
+ logger.debug(returnBody);
return new Pair<Integer, String>(response.getStatusLine().getStatusCode(), returnBody);
} catch (IOException e) {
@@ -111,8 +111,10 @@ public final class RESTManager {
HttpResponse response = client.execute(get);
String returnBody = EntityUtils.toString(response.getEntity(), "UTF-8");
- logger.debug("HTTP GET Response Status Code: " + response.getStatusLine().getStatusCode());
- logger.debug("HTTP GET Response Body: " + returnBody);
+
+ logger.debug("HTTP GET Response Status Code: {}", response.getStatusLine().getStatusCode());
+ logger.debug("HTTP GET Response Body:");
+ logger.debug(returnBody);
return new Pair<Integer, String>(response.getStatusLine().getStatusCode(), returnBody);
} catch (IOException e) {