Committed by
Gerrit Code Review
Revert "Using CommandSession console instead of System.* in AbstractShellCommand print and error"
This reverts commit ea9ae214. The karaf shell explicitly depends on System.{out,err}, so piping to shell commands is broken by this patchset. Change-Id: Ib7fb6341cfa42418115663413ea406173f5debf4 Note: When running as a service, if a thread that isn't the command thread calls print, it will go to $KARAF/var/System.out
Showing
1 changed file
with
2 additions
and
3 deletions
... | @@ -63,7 +63,7 @@ public abstract class AbstractShellCommand extends OsgiCommandSupport { | ... | @@ -63,7 +63,7 @@ public abstract class AbstractShellCommand extends OsgiCommandSupport { |
63 | * @param args arguments | 63 | * @param args arguments |
64 | */ | 64 | */ |
65 | public void print(String format, Object... args) { | 65 | public void print(String format, Object... args) { |
66 | - session.getConsole().println(String.format(format, args)); | 66 | + System.out.println(String.format(format, args)); |
67 | } | 67 | } |
68 | 68 | ||
69 | /** | 69 | /** |
... | @@ -73,8 +73,7 @@ public abstract class AbstractShellCommand extends OsgiCommandSupport { | ... | @@ -73,8 +73,7 @@ public abstract class AbstractShellCommand extends OsgiCommandSupport { |
73 | * @param args arguments | 73 | * @param args arguments |
74 | */ | 74 | */ |
75 | public void error(String format, Object... args) { | 75 | public void error(String format, Object... args) { |
76 | - //FIXME we write both out and err to the same console (stdout) | 76 | + System.err.println(String.format(format, args)); |
77 | - session.getConsole().println(String.format(format, args)); | ||
78 | } | 77 | } |
79 | 78 | ||
80 | /** | 79 | /** | ... | ... |
-
Please register or login to post a comment