If you want to do this properly, you need a log library like log4j in java. In practice it is quite useless:
The warning and errors should be on stderr, the rest on stdout. The debug stuff should just be suppressed or commented in the code.
I don't want to see the debug lines of someone else when I myself tr to debug something..
When I used log4j at work last year, I think that at the end we spend much more time fixing troubles coming form log4j itself than saving time thanks to it. It's just too heavy..

Fab

On 5/21/07, Rob Spearman <rob@digitaliseducation.com> wrote:

It would be easier to manage if we had some common debug methods to
print the different types of messages.  Then it's easy to manage what
messages go where and when.

In other languages it is possible to print out the calling class/method,
I assume this is possible in C++ somehow.

Rob

On Mon, 2007-05-21 at 16:35 +0100, Matthew Gates wrote:
> In my adventures so far, I think I've probably made quite an ugly mess of
> the console output.
>
> I would like to discuss some guidelines for tidying up this output.  Here
> are my idea about it, I'd like to hear what you think.  There is a very
> brief mention in the coding standards, but no details.
>
> I think we have four types of output which we might want to send to the
> console:
>
> * Errors - something which is going to cause Stellarium to crash, or some
> important operation to not function correctly.  Probably this can be
> further divided into fatal errors and recoverable errors.  Essentially
> stuff the user probably needs to know about.
>
> * Warnings - stuff which doesn't cause a crash and shouldn't significantly
> affect usage.  Stuff like missing or corrupt nebula textures (which can be
> simply not loaded), mal-formed records in data files which will be dropped,
> etc.
>
> * Informative - for example, "loaded x star records from stars0.cat".
> Things the user night car about, but should not be expected to know or
> react to.
>
> * Debugging - output of internal state which might be useful to  figure out
> a problem.  This is probably a sub-set of Informative - the more obscure
> information relating to internal state.
>
>
> I think Informative output should go to stdout, all others to stderr.
>
> I think Debugging output should not be done by default - only with some
> command line option, e.g. -d / --debug.  We may also want the option to
> compile without it at all to save some CPU cycles.
>
> Fatal errors should have some GUI-based mechanism for informing the user of
> a crash.
>
> For all types except "Informative", we should print the function name, or
> source file and line in the message, as well as what type of message it is,
> e.g.
>
> ERROR StelApp::StelApp(): Failed to do something important, quitting
> WARNING LandscapeMgr::getNameToDirMap: no landscape.ini in dir "."
> DEBUG StelApp::StelApp(): conf file = /home/matthew/.stellarium/config.ini
>
> Tell me if I am being too anal about this - I can get fanatical about
> debugging output formatting  :)  And of course, this is not a priority for
> the next release, but a long term goal.
>
>
> Matthew
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Stellarium-pubdevel mailing list
> Stellarium-pubdevel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel
--
  Digitalis Education Solutions, Inc.  tel 360.616.8915
  P.O. Box 2976                        fax 360.616.8917
  Bremerton, WA 98310                  http://digitaliseducation.com



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Stellarium-pubdevel mailing list
Stellarium-pubdevel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel