From 789552ac35830642855c6a5d6c16afa3c4eed109 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Fri, 29 Sep 2017 15:52:59 +0530 Subject: Remove CLI_DEV and replace by discover_always conf CLI-2 Change-Id: Ic67ac30c6f6c9a0a8928b1fac6d5adc85ca53a5b Signed-off-by: Kanagaraj Manickam k00365106 --- main/src/main/java/org/onap/cli/main/OnapCli.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'main/src') diff --git a/main/src/main/java/org/onap/cli/main/OnapCli.java b/main/src/main/java/org/onap/cli/main/OnapCli.java index 9255da20..35df0e37 100644 --- a/main/src/main/java/org/onap/cli/main/OnapCli.java +++ b/main/src/main/java/org/onap/cli/main/OnapCli.java @@ -37,6 +37,8 @@ import org.onap.cli.fw.output.ResultType; import org.onap.cli.main.conf.OnapCliConstants; import org.onap.cli.main.interactive.StringCompleter; import org.onap.cli.main.utils.OnapCliUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import jline.TerminalFactory; import jline.console.ConsoleReader; @@ -47,6 +49,8 @@ import jline.console.ConsoleReader; */ public class OnapCli { + private static Logger LOG = LoggerFactory.getLogger(OnapCli.class); + private List args = new ArrayList<>(); private int exitCode = -1; @@ -68,14 +72,8 @@ public class OnapCli { } private void print(Throwable throwable) { - System.out.println(throwable.getMessage()); - try { - if (OnapCommandRegistrar.getRegistrar().isDevMode()) { - throwable.printStackTrace(); // NOSONAR - } - } catch (OnapCommandException e) { - System.out.println(e); - } + this.print(throwable.getMessage()); + LOG.error(throwable.getMessage(), throwable); } private String getShortOption(String opt) { -- cgit 1.2.3-korg