diff mbox series

[PULL,v2,14/18] ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment

Message ID 20230313200134.503083-15-marcandre.lureau@redhat.com
State New
Headers show
Series [PULL,v2,01/18] ui/dbus: initialize cursor_fb | expand

Commit Message

Marc-André Lureau March 13, 2023, 8:01 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

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 | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

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());