Skip to content

Commit b33bce6

Browse files
committed
force all print statements into the log
1 parent 519c1ae commit b33bce6

File tree

1 file changed

+5
-1
lines changed
  • src/main/java/com/neuronrobotics/sdk/common

1 file changed

+5
-1
lines changed

src/main/java/com/neuronrobotics/sdk/common/Log.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public class Log {
7575

7676
/** The out stream. */
7777
private static PrintStream outStream = System.out;
78+
/** The out stream. */
79+
private static PrintStream errStream = System.err;
7880

7981
/** The use colored prints. */
8082
private boolean useColoredPrints=false;
@@ -168,7 +170,7 @@ private void add(String message, int importance) {
168170
if( systemprint) {
169171
outStream.println(m.toString());
170172
if(outStream != System.out)
171-
System.err.println(m);
173+
errStream.println(m);
172174
}
173175

174176

@@ -458,6 +460,8 @@ public void write(int b) throws IOException {
458460
incoming.add(b);
459461
}
460462
};
463+
System.setOut(new PrintStream(stream));
464+
System.setErr(new PrintStream(stream));
461465
setOutStream(new PrintStream(stream));
462466
while (instance.log!=null) {
463467
ThreadUtil.wait(150);

0 commit comments

Comments
 (0)