aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/rest/src
diff options
context:
space:
mode:
authorMagnusen, Drew (dm741q) <dm741q@att.com>2017-08-24 11:37:46 -0500
committerMagnusen, Drew (dm741q) <dm741q@att.com>2017-08-28 13:07:09 -0500
commit11e0afc41aa47b9b5fe36c6c654c5b7493e4ba46 (patch)
treeb05742106ad95c9f47a006f36eb87aabb784ca1e /controlloop/common/model-impl/rest/src
parentd03507850e293674cc118f76bab0629d457179ae (diff)
Removal of sys.out/err with logger messages
Removed any use of System.out.println or System.err.println and replaced with relevant logger statements. Issue-ID: POLICY-176 Change-Id: I91513267635bfb2a34f2a9650c48f367d53fc842 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
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) {