From 4acab28f3f9e444228b1b16ad3577ade343a4a32 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Thu, 17 Dec 2020 11:43:38 +0100 Subject: [PATCH] c/client: Port printfs to static u_logging. --- src/xrt/compositor/client/comp_egl_glue.c | 2 +- src/xrt/compositor/client/comp_gl_client.c | 6 +++--- src/xrt/compositor/client/comp_gl_xlib_client.c | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/xrt/compositor/client/comp_egl_glue.c b/src/xrt/compositor/client/comp_egl_glue.c index 8e32fb914..06c6aa81b 100644 --- a/src/xrt/compositor/client/comp_egl_glue.c +++ b/src/xrt/compositor/client/comp_egl_glue.c @@ -194,7 +194,7 @@ xrt_gfx_provider_create_gl_egl(struct xrt_compositor_native *xcn, if (!client_gl_compositor_init(c, xcn, sc_create)) { free(c); - fprintf(stderr, "Failed to initialize compositor\n"); + U_LOG_E("Failed to initialize compositor"); old_restore(&old); return NULL; } diff --git a/src/xrt/compositor/client/comp_gl_client.c b/src/xrt/compositor/client/comp_gl_client.c index 3c874adb2..c0ea7502c 100644 --- a/src/xrt/compositor/client/comp_gl_client.c +++ b/src/xrt/compositor/client/comp_gl_client.c @@ -342,9 +342,9 @@ vk_format_to_gl(int64_t format) case 129 /*VK_FORMAT_D24_UNORM_S8_UINT*/: return GL_DEPTH24_STENCIL8; case 130 /*VK_FORMAT_D32_SFLOAT_S8_UINT*/: return GL_DEPTH32F_STENCIL8; default: - printf("Cannot convert VK format 0x%016" PRIx64 - " to GL format!\n", - format); + U_LOG_W("Cannot convert VK format 0x%016" PRIx64 + " to GL format!\n", + format); return 0; } } diff --git a/src/xrt/compositor/client/comp_gl_xlib_client.c b/src/xrt/compositor/client/comp_gl_xlib_client.c index 1932f6f9b..0f15d8871 100644 --- a/src/xrt/compositor/client/comp_gl_xlib_client.c +++ b/src/xrt/compositor/client/comp_gl_xlib_client.c @@ -11,6 +11,7 @@ #include #include "util/u_misc.h" +#include "util/u_logging.h" #include "xrt/xrt_gfx_xlib.h" @@ -57,13 +58,11 @@ client_gl_xlib_compositor_create(struct xrt_compositor_native *xcn, { gladLoadGL(glXGetProcAddress); - // @todo log this to a proper logger. #define CHECK_REQUIRED_EXTENSION(EXT) \ do { \ if (!GLAD_##EXT) { \ - fprintf(stderr, \ - "%s - Required OpenGL extension " #EXT \ - " not available\n", \ + U_LOG_E("%s - Required OpenGL extension " #EXT \ + " not available", \ __func__); \ return NULL; \ } \