[Flightgear-devel] Shut up, already!

2003-11-24 Thread David Megginson
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


Re: [Flightgear-devel] Shut up, already!

2003-11-24 Thread Andy Ross
David Megginson wrote:
 I've just checked in a few changes to start cutting down the noise:

No!  But... but... if you do this, then no one will remember that the
default type for a panel layer is texture, or that bindings are read
during initialization.  Just think what will happen when everyone
forgets that their materials are already loaded!

Seriously, bless you. :)

 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).

What about the presumptively useful stuff like the JSBSim touchdown
report or YASim solution data?  Would it be a good idea to split out
the stuff that we actually want to display to the user under normal
conditions into a separate stream, rather than overloading the
concept of error importance to do this?

Or maybe the Right Thing is just to stick this stuff into the property
tree and expose it via the GUI...

Andy



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


Re: [Flightgear-devel] Shut up, already!

2003-11-24 Thread David Megginson
Andy Ross wrote:

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).
What about the presumptively useful stuff like the JSBSim touchdown
report or YASim solution data?  Would it be a good idea to split out
the stuff that we actually want to display to the user under normal
conditions into a separate stream, rather than overloading the
concept of error importance to do this?
Yes, I'm concerned about this stuff as well -- people should not have to 
enable hundreds of lines of mundane logging just to see the touchdown report.

Or maybe the Right Thing is just to stick this stuff into the property
tree and expose it via the GUI...
Or perhaps we could link it to a command (fdm-report) or something 
similar.  In JSBSim, I think, it's a function that's called explicitly by 
JSBSim.cxx.  Perhaps the other FDM's could add a reporting facility the same 
way.

All the best,

David

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


Re: [Flightgear-devel] Shut up, already!

2003-11-24 Thread Jon S Berndt
On Mon, 24 Nov 2003 13:49:58 -0500
 David Megginson [EMAIL PROTECTED] wrote:
Andy Ross wrote:

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).
What about the presumptively useful stuff like the JSBSim touchdown
report or YASim solution data?  Would it be a good idea to split out
the stuff that we actually want to display to the user under normal
conditions into a separate stream, rather than overloading the
concept of error importance to do this?
Or perhaps we could link it to a command (fdm-report) or something 
similar.  In JSBSim, I think, it's a function that's called 
explicitly by JSBSim.cxx.  Perhaps the other FDM's could add a 
reporting facility the same way.


First of all, yes, David M. I agree this was a good idea.  It was 
something I recall I was supposed to have done a while back.  The 
philosophy is one I agree with, but as a developer and with JSBSim 
in constant development, I'll probably set my environment variable 
here to always show the stuff, anyhow.

As far as the takeoff/landing reports, this is something I've given 
some thought to for a while.  You might know about the Message setup 
we have in JSBSim.  We could probably work it so that instead of 
giving console output for the takeoff/landing reports (or anything 
else that is meant as a user-readable notification), we could instead 
send a text message to our FGInterface (in our case, FGJSBSim ??)  and 
make that text available for the user.  I expect they would hit 
Pause, and select a menu option: Performance Report, or Takeoff 
Report, etc.

Jon

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


Re: [Flightgear-devel] Shut up, already!

2003-11-24 Thread Erik Hofman
David Megginson wrote:
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:
Excellent. I've had a few attempts in that direction but it looks like 
you've done it now.

Erik

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