drv: Do not send log msgs to stdout

On non-Android, minigbm sent error messages to stderr, and all other log
messages to stdout. Logging should NEVER go to stdout, because it
corrupts the output of programs that send structured output to stdout,
such as vulkaninfo.

BUG=none
TEST=build

Change-Id: Ia36285af50e3a2fa0fdf91f1e12a6c64ebc13944
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4756817
Auto-Submit: Lina Versace <linyaa@google.com>
Reviewed-by: Miguel Casas-Sanchez <mcasas@chromium.org>
Tested-by: Lina Versace <linyaa@google.com>
Reviewed-by: Dawn Han <dawnhan@google.com>
Commit-Queue: Lina Versace <linyaa@google.com>
This commit is contained in:
Lina Versace 2023-08-07 14:32:46 -07:00 committed by Chromeos LUCI
parent a13a4ccde3
commit c445362dbf

9
drv.c
View file

@ -753,13 +753,8 @@ void drv_log_prefix(enum drv_log_level level, const char *prefix, const char *fi
};
__android_log_vprint(prio, buf, format, args);
#else
if (level == DRV_LOGE) {
fprintf(stderr, "%s ", buf);
vfprintf(stderr, format, args);
} else {
fprintf(stdout, "%s ", buf);
vfprintf(stdout, format, args);
}
fprintf(stderr, "%s ", buf);
vfprintf(stderr, format, args);
#endif
va_end(args);
}