summary refs log tree commit diff stats
path: root/ui/sdl2.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-02-15 18:27:46 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-03-13 23:48:45 +0400
commit82f483dd22c15277cea6047fd46671467eb289a9 (patch)
tree15b56fd56db7eed0b7c78fbea23b13fc98fdbffe /ui/sdl2.c
parent1f086ef642edb9489af30753ef49e5ee5dbbba95 (diff)
downloadfocaccia-qemu-82f483dd22c15277cea6047fd46671467eb289a9.tar.gz
focaccia-qemu-82f483dd22c15277cea6047fd46671467eb289a9.zip
ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment
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>
Diffstat (limited to 'ui/sdl2.c')
-rw-r--r--ui/sdl2.c4
1 files changed, 4 insertions, 0 deletions
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());