Committed by
Gerrit Code Review
Using CommandSession console instead of System.*
in AbstractShellCommand print and error This fixes a bug where print() works intermittently on the Linux servers and error() doesn't work at all. fixes ONOS-986 Change-Id: I086fea9f999992990935d54a6d15d55a7fb4cfea
Showing
1 changed file
with
3 additions
and
2 deletions
... | @@ -62,7 +62,7 @@ public abstract class AbstractShellCommand extends OsgiCommandSupport { | ... | @@ -62,7 +62,7 @@ public abstract class AbstractShellCommand extends OsgiCommandSupport { |
62 | * @param args arguments | 62 | * @param args arguments |
63 | */ | 63 | */ |
64 | public void print(String format, Object... args) { | 64 | public void print(String format, Object... args) { |
65 | - System.out.println(String.format(format, args)); | 65 | + session.getConsole().println(String.format(format, args)); |
66 | } | 66 | } |
67 | 67 | ||
68 | /** | 68 | /** |
... | @@ -72,7 +72,8 @@ public abstract class AbstractShellCommand extends OsgiCommandSupport { | ... | @@ -72,7 +72,8 @@ public abstract class AbstractShellCommand extends OsgiCommandSupport { |
72 | * @param args arguments | 72 | * @param args arguments |
73 | */ | 73 | */ |
74 | public void error(String format, Object... args) { | 74 | public void error(String format, Object... args) { |
75 | - System.err.println(String.format(format, args)); | 75 | + //FIXME we write both out and err to the same console (stdout) |
76 | + session.getConsole().println(String.format(format, args)); | ||
76 | } | 77 | } |
77 | 78 | ||
78 | /** | 79 | /** | ... | ... |
-
Please register or login to post a comment