Reading Eric Raymond's excellent new book, The Art of Unix Programming, reminded me of the importance of programs staying quiet unless (a) they have something critically important to say (i.e. "help, I'm about to die"), or (b) the caller explicit asks them to be noisy.

Of all the programs I normally use, FlightGear is by an order of magnitude the worst offender against this rule. As a result, I've just checked in a few changes to start cutting down the noise:

1. The default log level is now FG_ALERT, or at least, it's supposed to be (though some FG_WARN messages inexplicably still get through).

2. I hunted down some cout/cerr and printf statements, and converted them to SG_LOG.

3. I lowered the priority of many FG_ALERT and FG_WARN logging statements. FG_WARN should be reserved for "the program might crash or exit", and FG_ALERT should be reserved for "the program is almost certainly going to crash or exit". FG_DEBUG and FG_INFO are more reasonable levels for other kinds of information, like "I didn't find the 3D model I was looking for".

4. I put together a crude integration between FlightGear's SG_LOG facility and JSBSim's debug_lvl variable, so that JSBSim will also try to be quiet when FlightGear is trying to be quiet. I've forward-ported the changes to JSBSim CVS as well

The ideal is for FlightGear to produce *no* (nada, rien, zero, naught, nichts, niente, nichevo) console output during a normal run -- if any text is displayed when the user did *not* request verbose output, then we should be able to assume that something is seriously wrong with FlightGear or the arguments provided by the user. Help will be appreciated.


All the best,



David



_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to