From: Matthew G. <mat...@gm...> - 2008-02-24 16:29:27
|
During the QT-ization process, I have been swapping out cerr diagnostic output to qWarning(), qDebug(), and qFatal() output as appropriate. I think we should do this for all console output. We can then write a message handler to do something useful with this output which is appropriate to the OS. See qInstallMsgHandler in the QT docs for more information. There are a few things I would like to get your ideas on: 1. What to do about messages which are to be printed to standard output (e.g. --version option output, text splash). I think using cout is OK here, but welcome other ideas. 2. I think it would be helpful to have an explicit statement of when to use each level of error message, and what this means for the user. I propose: - qDebug() output is aimed mostly at developers. This would include the normal loading diagnostic "Loading" messages. - qWarning() output is still aimed mostly at developers, but should indicate some unexpected condition which does not cause an immediate problem but may have user-visible consequences . Example: unable to locate or load a planet or nebula texture. - qFatal() is to notify the user that a serious problem has occurred and that Stellarium cannot (or probably cannot) continue to run. fatal messages should be presented to the user before unexpected termination of the program even if the user cannot see conole output. I think a dialog box is a suitable mechanism for this. They are intrusive, but if all is well the user should never see one. - qCritical() I don't see a reason to use this at present - qWarning() and qFatal() seem adequate to me. 3. We have some problems with users pasting diagnostic output into bug reports (which I often request of them): * On Windows the cmd window has too small a scroll buffer and we lose some output. The cmd window settings confuse the heck out of many users who simple cannot figure out how to copy the text in the window. Thirdly, the window vanishes if Stellarium crashes, meaning we cannot see output from the most important bugs (and persuading windows users to run from a cmd window and then to copy-paste is not always easy). Lastly, many windows users hate this window appearing in the first place. I think we should get rid of it. * On other platforms (mostly OSX, but increasingly Linux too as the OS gains a less technical audience), I believe we lose some feedback because launching from the console is quite challenging for some people who are only used to running from some graphical launcher. I would like to see two mechanisms for lowering the barrier to good bug reporting: * Some sort of log file in the user data directory containing the output of the functions listed above. The most important reason is for windows users to be able to get diagnostic output after a crash. * An in-program way to see diagnostic output, and copy it to the clipboard - perhaps something like the tilde menu which ID software games have (aka. the "quake" console). Let me know what you think. My apologies for the long posting. Matthew |