diff options
author | varun gudisena <vg411h@att.com> | 2017-09-23 00:02:17 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-23 00:02:17 +0000 |
commit | 16ddd05cd07ca9fcb2ea2d7fc8228f2258f85db5 (patch) | |
tree | 0fda89874197461142bdb1167354910a7b03276a | |
parent | 995687194e05aff1e6504a98d8ce2b7c233464c0 (diff) | |
parent | 547a353b8329b253f032b9889ea1cf97a6d3469d (diff) |
Merge "Fix for Sonar critical issues"
-rw-r--r-- | src/main/java/com/att/nsa/mr/tools/MessageCommand.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/com/att/nsa/mr/tools/MessageCommand.java b/src/main/java/com/att/nsa/mr/tools/MessageCommand.java index 2c646bf..97216c4 100644 --- a/src/main/java/com/att/nsa/mr/tools/MessageCommand.java +++ b/src/main/java/com/att/nsa/mr/tools/MessageCommand.java @@ -26,6 +26,9 @@ import java.io.PrintStream; import java.util.List; import java.util.concurrent.TimeUnit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.att.nsa.cmdtool.Command; import com.att.nsa.cmdtool.CommandNotReadyException; import com.att.nsa.mr.client.MRBatchingPublisher; @@ -36,7 +39,7 @@ import com.att.nsa.mr.client.MRPublisher.message; public class MessageCommand implements Command<MRCommandContext> { - + final Logger logger = LoggerFactory.getLogger(ApiKeyCommand.class); @Override public String[] getMatches () { @@ -73,6 +76,7 @@ public class MessageCommand implements Command<MRCommandContext> catch ( Exception e ) { out.println ( "Problem fetching messages: " + e.getMessage() ); + logger.error("Problem fetching messages: ", e); } finally { @@ -94,6 +98,7 @@ public class MessageCommand implements Command<MRCommandContext> catch ( IOException e ) { out.println ( "Problem sending message: " + e.getMessage() ); + logger.error("Problem sending message: ", e); } finally { @@ -105,10 +110,12 @@ public class MessageCommand implements Command<MRCommandContext> catch ( IOException e ) { out.println ( "Problem sending message: " + e.getMessage() ); + logger.error("Problem sending message: ", e); } catch ( InterruptedException e ) { out.println ( "Problem sending message: " + e.getMessage() ); + logger.error("Problem sending message: ", e); } if ( left != null && left.size () > 0 ) { |