Revert "Using CommandSession console instead of System.* in AbstractShellCommand print and error"
This reverts commit ea9ae214f9bca97537378f205910d62b7aa4be47.
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
diff --git a/cli/src/main/java/org/onosproject/cli/AbstractShellCommand.java b/cli/src/main/java/org/onosproject/cli/AbstractShellCommand.java
index 6e6eb03..5e87a2a 100644
--- a/cli/src/main/java/org/onosproject/cli/AbstractShellCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/AbstractShellCommand.java
@@ -63,7 +63,7 @@
* @param args arguments
*/
public void print(String format, Object... args) {
- session.getConsole().println(String.format(format, args));
+ System.out.println(String.format(format, args));
}
/**
@@ -73,8 +73,7 @@
* @param args arguments
*/
public void error(String format, Object... args) {
- //FIXME we write both out and err to the same console (stdout)
- session.getConsole().println(String.format(format, args));
+ System.err.println(String.format(format, args));
}
/**