]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 15 Feb 2023 14:27:46 +0000 (18:27 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 13 Mar 2023 19:48:45 +0000 (23:48 +0400)
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 <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
ui/sdl2.c

index 137f7ab57ff822b2b1b0a20542a6d838fe36934c..221cdced6021e4ded8d50a5ffe12810b583af70a 100644 (file)
--- 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());