Open andreabergia opened 4 days ago
Actually...
I'm not convinced that this is a good idea. "ShellConsole" is a thin abstraction that wraps various types of output streams (PrintWriters, which wrap PrintStreams, in this case), that already has the same abstraction for printing and flushing that Java streams have had forever.
Adding "flush" calls is something that seems trivial and will probably help in some cases, but in others it could have a huge performance impact, and I'd rather not break those folks.
Depending on the use case, MAYBE console.log itself (or perhaps the ShellConsolePrinter) class should flush, but I'm not even sure of that.
Can you talk about the use case that's driving this?
Not really sure this deserves a big description. 🙂 We just want to ensure that any
console.log
actually ends up being printed immediately and not buffered.