Re: [Openjnlp-devel] Handling System.err (and System.out)
Brought to you by:
kherr
From: Kevin H. <ke...@na...> - 2002-06-14 18:43:08
|
On Thursday, June 6, 2002, at 12:46 AM, Christopher Heiny wrote: > I've noticed we tend to lose a lot of information written to System.err > (and > in some cases to System.out). System.err is especially important, since Are messages really being lost? My testing shows all messages. On Mac OS X they go to the system console until the GUI comes up, and then into the Console window. If I run from the command line the messages show up in my terminal window. > right now loading and/or applications can fail silently, leaving the > user (or > even the developer :-) ) to wonder what the heck happened, and probably > abandoning OpenJNLP abandoning for other solutions. This is a really tough problem to address, I've run into this before on other projects that launch Java apps. There is no way to tell if a Java app "fails" other than the obvious like not finding the main class. Once it starts running the class loader may fail to find a class but that doesn't necessarily mean the app failed. > Here's what I propose to do as a solution: > 1) when running from CLI, redirect application System.err/System.out > to [...] > 2) when running from the GUI, instead of copying System.err to the > console > or bitbucket, we should be displaying all messages immediately. I > suggest > popping up a JOptionPane that displays the System.err stream for that > source > in a scrollable JTextArea. The user can then examine the message, and > close > the pane or leave it open. If left open, it will receive any further > messages (although if new messages arrive after some period of > quiesence, the > pane should be flashed, beeped, brought to the top or otherwise > highlighted); > if closed, it will be reopened on the next message. I'd have to disagree with this. This would get annoying very quickly. The whole point of the console is to provide the capability to see diagnostic messages but in a non-obtrusive manner. It is impossible to tell which messages are "alert" messages and which are normal output by the app that's being run. Because the messages go into the console even when it's not visible, a user can always see what's happening or has happened. Have you tried Java Web Start to see how it behaves? I've noticed that you can launch an app with its own console open which has its advantages but doesn't give the user a feeling of centralized management. |