pashapm / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Console Output override over the gui #137

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using lanterna gui to make a program and that program can output a lot of 
messages to the console but by doing that the messages are written above the 
gui graphics is there a way to stop this?

Original issue reported on code.google.com by stefan19...@live.com on 28 Jun 2015 at 12:14

GoogleCodeExporter commented 9 years ago
Not really, they are writing into the same stream after all. If all unwanted 
output is on standard output, you could redirect it to somewhere else and have 
Lanterna output on standard error (or vice versa) but in general there's no 
good way to solve this.

Original comment by mab...@gmail.com on 28 Jun 2015 at 12:31

GoogleCodeExporter commented 9 years ago
hum, thanks for the reply, is there another api that is able to ignore console 
logs?

Original comment by stefan19...@live.com on 28 Jun 2015 at 2:10

GoogleCodeExporter commented 9 years ago
Not quite sure how you would accomplish this...? What do you want to happen 
with the standard output/standard error output from your program?

Original comment by mab...@gmail.com on 28 Jun 2015 at 11:43

GoogleCodeExporter commented 9 years ago
I would like my program to output exceptions and what more, and I want the gui 
graphics to be written above those words, like ignore them or just let them run 
in the background where I cant see even if both of them are using the same 
terminal window

Original comment by stefan19...@live.com on 28 Jun 2015 at 11:57

GoogleCodeExporter commented 9 years ago
Okay, you might be able to change System.out and System.err after Lanterna has 
been initialized. I've seen this done before, even though it's a bit weird. If 
the code that's writing to system out and/or system err isn't Java though, 
there's not much you can do. There is a way to tell the Screen that is hosting 
the GUI that all content in the terminal window is invalid and force it to 
"re-draw" the whole screen. You might be able to do that periodically or after 
you suspect the code has output some text.

Original comment by mab...@gmail.com on 29 Jun 2015 at 2:06

GoogleCodeExporter commented 9 years ago
oh ok

Original comment by stefan19...@live.com on 29 Jun 2015 at 2:18

GoogleCodeExporter commented 9 years ago
thanks ;)

Original comment by stefan19...@live.com on 29 Jun 2015 at 2:18