From 11e0afc41aa47b9b5fe36c6c654c5b7493e4ba46 Mon Sep 17 00:00:00 2001 From: "Magnusen, Drew (dm741q)" Date: Thu, 24 Aug 2017 11:37:46 -0500 Subject: 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) --- .../mso/src/main/java/org/onap/policy/mso/MSOManager.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'controlloop/common/model-impl/mso/src/main/java') diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java index 9f4fe5bbc..c23935586 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java @@ -60,8 +60,8 @@ public final class MSOManager { MSOResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, MSOResponse.class); String body = Serialization.gsonPretty.toJson(response); - System.out.println("***** Response to post:"); - System.out.println(body); + logger.debug("***** Response to post:"); + logger.debug(body); String requestId = response.requestReferences.requestId; int attemptsLeft = 20; @@ -75,24 +75,26 @@ public final class MSOManager { Pair httpDetailsGet = RESTManager.get(urlGet, username, password, headers); responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, MSOResponse.class); body = Serialization.gsonPretty.toJson(responseGet); - System.out.println("***** Response to get:"); - System.out.println(body); + logger.debug("***** Response to get:"); + logger.debug(body); if(httpDetailsGet.a == 200){ if(responseGet.request.requestStatus.requestState.equalsIgnoreCase("COMPLETE") || responseGet.request.requestStatus.requestState.equalsIgnoreCase("FAILED")){ - System.out.println("***** ######## VF Module Creation "+responseGet.request.requestStatus.requestState); + logger.debug("***** ######## VF Module Creation "+responseGet.request.requestStatus.requestState); return responseGet; } } Thread.sleep(20000); } + if (responseGet != null && responseGet.request != null && responseGet.request.requestStatus != null && responseGet.request.requestStatus.requestState != null) { logger.warn("***** ######## VF Module Creation timeout. Status: ( {})", responseGet.request.requestStatus.requestState); } + return responseGet; } catch (JsonSyntaxException e) { logger.error("Failed to deserialize into MSOResponse: ", e); -- cgit 1.2.3-korg