Closed LancePutnam closed 12 years ago
I completely agree.
I added two new macros AL_WARN and AL_WARN_ONCE to allocore/system/al_Printing.hpp to handle printing error/warning messages to stderr. Both are equivalent to fprintf(stderr, fmt, ...) taking a format string with variable args. The only difference is that AL_WARN_ONCE only prints the final formatted message once during the program life cycle. AL_WARN_ONCE should be used in favor of AL_WARN when reporting may take place inside of a real-time loop, such as the graphics loop, to prevent a continuous stream of error messages being printed out to the terminal that may mask preceding error messages.
There are many places where error messages are sent to stdout like this:
printf("Error: Something went wrong...\n");
Errors should be piped to stderr, not stdout. The above should be replaced with this:
fprintf(stderr, "Error: Something went wrong...\n");
Note, that by default stderr prints to the console like stdout. The advantage of using stderr is that you can separate errors from normal output. See: http://jstorimer.com/2011/12/29/the-difference-between-stdout-and-stderr.html