Skip to content
Snippets Groups Projects
Commit aee29d1d authored by dgelessus's avatar dgelessus
Browse files

Log probcli stderr output to Eclipse log, not just Eclipse stderr

This is more accessible to the average user. Running Eclipse with
visible stderr isn't always easy, depending on the OS.
parent bc3834e9
Branches
No related tags found
No related merge requests found
...@@ -197,12 +197,12 @@ public final class CliStarter { ...@@ -197,12 +197,12 @@ public final class CliStarter {
} }
private void startOutputLogger(final BufferedReader input) { private void startOutputLogger(final BufferedReader input) {
stdLogger = new OutputLoggerThread("(Output " + port + ")", input); stdLogger = new OutputLoggerThread("(Output " + port + ")", input, false);
stdLogger.start(); stdLogger.start();
} }
private void startErrorLogger(final BufferedReader output) { private void startErrorLogger(final BufferedReader output) {
errLogger = new OutputLoggerThread("(Error " + port + ")", output); errLogger = new OutputLoggerThread("(Error " + port + ")", output, true);
errLogger.start(); errLogger.start();
} }
...@@ -272,12 +272,15 @@ public final class CliStarter { ...@@ -272,12 +272,15 @@ public final class CliStarter {
private final String prefix; private final String prefix;
private final boolean logToLog;
private volatile boolean shutingDown = false; private volatile boolean shutingDown = false;
public OutputLoggerThread(final String name, final BufferedReader in) { public OutputLoggerThread(final String name, final BufferedReader in, boolean logToLog) {
super(); super();
prefix = "[" + name + "] "; prefix = "[" + name + "] ";
this.in = in; this.in = in;
this.logToLog = logToLog;
} }
@Override @Override
...@@ -289,7 +292,9 @@ public final class CliStarter { ...@@ -289,7 +292,9 @@ public final class CliStarter {
if (line == null) { if (line == null) {
break; break;
} }
// Logger.log(IStatus.INFO, prefix + line, null); if (logToLog) {
Logger.log(IStatus.INFO, prefix + line, null);
}
System.err.println(prefix + line); System.err.println(prefix + line);
} }
} catch (IOException e) { } catch (IOException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment