diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-09-29 15:52:59 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-09-29 15:54:27 +0530 |
commit | 789552ac35830642855c6a5d6c16afa3c4eed109 (patch) | |
tree | 8a2bdaa740c126dc280574447c71766e0598b1df /main/src | |
parent | eeed87109a19fdf834fc77f8926f094ce29e6467 (diff) |
Remove CLI_DEV and replace by discover_always conf
CLI-2
Change-Id: Ic67ac30c6f6c9a0a8928b1fac6d5adc85ca53a5b
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/main/java/org/onap/cli/main/OnapCli.java | 14 |
1 files changed, 6 insertions, 8 deletions
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<String> 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) { |