I want to make a request regarding printing debug messages in code. You
will have noticed that I always use this:
rather than this:
or this (arrgghh):
puts("debug : message");
Clearly, this final form should never be used in any checked-in code, and
I think there are many good reasons for using the first rather than the
- It is neater and makes code easier to read. I am a huge fan of tidy
- Debug messages are consistent; they report the program, file and
function from which they are generated. This may not be much use for
debugging your own code, but is very helpful for other people (who
otherwise have to start greping).
- You can change the structure of all the debug messages in a program
simply by re-defining the message macros. Want more or less verbose
messages? Define a number of different macros that get
instantiated for different VERBOSE settings. Want debug messages to go
to stderr rather than stdout? Re-define the macro. And so on.
Naturally, I think we should be doing the same thing for warning and
error messages in both player and stage. Is anyone with me on this?
Andrew Howard email: ahoward@...
Department of Computer Science http: www-robotics.usc.edu/~ahoward
University of Southern California phone: 1 (213) 740 6416
Los Angeles, CA, U.S.A. 90089-0781 fax: 1 (213) 740 7512
<< Insert pithy saying here >>>