* John Denker -- Sunday 04 March 2007:
> On 03/03/2007 05:18 PM, Durk Talsma wrote:
> > Personally, I don't object against commented-out cout / cerr statements 
> > in the code if the author wants to retain them for ongoing development. 
> 
> Agreed!
> 
> There are thousands of such couts in the code already, and they serve
> a useful purpose.

Again, I didn't say/mean that commented out "cout" must be removed, but
only active ones, of which there were a lot, and there are still some left:

+  cout << "**** ATIS active on:";
[...]
+  cout << " ****" << endl;
+  cout << transmission << endl;

This *needs* to be SG_LOG with log-level "info". It is neither "alert"
nor "warn". If you don't remove them now, then I'll just remove them
once it's committed. With the difference that I won't put SG_LOG
replacements there. Your call. :-P

And this is not *my* idea. This is how the system was designed. And
there were times where other developers took care of that. Nowadays
I seem to be the only one left who still tries to keep things clean
and consistent, even if that means occasional hate mails. It should
be the project leader's job to receive hate mails, not mine.  ;-)



[from the original post]
> *) ATIS messages now in property tree, so it can be read e.g. by the
>   http interface.

This is a good thing, but for consistency reasons it should not be
written to "/instrumentation/" + act->first + "/atis", but to
/sim/messages/atis. The /sim/messages/* properties are exactly for such
purposes. Other subsystems are already posting messages there.
See $FG_ROOT/Nasal/screen.nas, where listeners are attached to display
messages on screen. Everyone interested in having the ATIS messages
in the terminal can then easily add this to a local Nasal file:

  _setlistener("/sim/messages/atis", func { print(cmdarg().getValue()) });

... and those not interested in the messages don't have their terminal
cluttered with stuff, when they are actually only interested in their
own debug messages (such as from temporarily uncommented cout ;-).

Or add this to have the ATIS messages printed on top of the screen:

  _setlistener("/sim/messages/atis", func {
      setprop("/sim/screen/blue", cmdarg().getValue());
  });

Whereby one would probably have to split the message into single
lines, which is left as an exercise to the student.  :-}

m.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to