Skip to content

Commit

Permalink
Fix system out / err streams when redirecting to file (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jan 24, 2023
1 parent b8028d2 commit 33422a3
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,22 @@ private boolean doAccept(Message entry) {
}
case Message.PRINT_OUT: {
Message.StringMessage d = (Message.StringMessage) entry;
clearDisplay();
System.out.printf("%s%n", d.getMessage());
if (log instanceof FileLog) {
log.accept(d.getMessage());
} else {
clearDisplay();
System.out.printf("%s%n", d.getMessage());
}
break;
}
case Message.PRINT_ERR: {
Message.StringMessage d = (Message.StringMessage) entry;
clearDisplay();
System.err.printf("%s%n", d.getMessage());
if (log instanceof FileLog) {
log.accept(d.getMessage());
} else {
clearDisplay();
System.err.printf("%s%n", d.getMessage());
}
break;
}
case Message.PROMPT: {
Expand Down

0 comments on commit 33422a3

Please sign in to comment.