always print error messages, unless LIBGL_DEBUG=quiet

This commit is contained in:
Bernardo Innocenti 2007-03-27 08:05:33 -06:00 committed by Brian
parent 98abd1bbc8
commit a835939222
1 changed files with 5 additions and 1 deletions

View File

@ -81,11 +81,15 @@ static void InfoMessageF(const char *f, ...)
}
}
/**
* Print error to stderr, unless LIBGL_DEBUG=="quiet".
*/
static void ErrorMessageF(const char *f, ...)
{
va_list args;
const char *env;
if (getenv("LIBGL_DEBUG")) {
if ((env = getenv("LIBGL_DEBUG")) && !strstr(env, "quiet")) {
fprintf(stderr, "libGL error: ");
va_start(args, f);
vfprintf(stderr, f, args);