From 82f483dd22c15277cea6047fd46671467eb289a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 15 Feb 2023 18:27:46 +0400 Subject: [PATCH] ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Enable SDL logging when QEMU_ENABLE_SDL_LOGGING variable is set, as suggested by Sam Lantinga, upstream SDL maintainer. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/sdl2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 137f7ab57f..221cdced60 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -843,6 +843,10 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) } #endif + if (SDL_GetHintBoolean("QEMU_ENABLE_SDL_LOGGING", SDL_FALSE)) { + SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE); + } + if (SDL_Init(SDL_INIT_VIDEO)) { fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", SDL_GetError()); -- 2.39.2