From: Joonbum Ko Date: Thu, 3 Sep 2020 06:33:36 +0000 (+0900) Subject: wayland-egl-tizen: changed to use dlog to print logs. X-Git-Tag: submit/tizen/20200911.080016~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fca3077daabf68f1dfe116fe9691a75d85a54cc9;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git wayland-egl-tizen: changed to use dlog to print logs. Change-Id: Ia248ca9b2ca3c6877a5e0844efa357be7f39ecba Signed-off-by: Joonbum Ko --- diff --git a/configure.ac b/configure.ac index 71e4070..e59d587 100644 --- a/configure.ac +++ b/configure.ac @@ -102,7 +102,9 @@ AS_IF([test "${enable_dlog}" = "yes" || test "${enable_dlog}" = "1"], [PKG_CHECK_MODULES([DLOG], [dlog]) TPL_CFLAGS+="$DLOG_CFLAGS" TPL_CFLAGS+=" -DDLOG_DEFAULT_ENABLE " - TPL_LIBS+="$DLOG_LIBS"], + TPL_LIBS+="$DLOG_LIBS" + WL_EGL_TIZEN_CFLAGS+="$DLOG_CFLAGS" + WL_EGL_TIZEN_LIBS+="$DLOG_LIBS"], []) AM_CONDITIONAL([ENABLE_DLOG], [test "${enable_dlog}" = "yes" || test "${enable_dlog}" = "1"]) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 16495d3..f360f7d 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -112,6 +112,7 @@ the GPU Vendor DDK's EGL. Version: %{WL_EGL_TIZEN_VERSION} Release: 0 Summary: Wayland EGL TIZEN backend +BuildRequires: pkgconfig(dlog) %description -n libwayland-egl-tizen This package provides tizen specific extension of wayland-egl. diff --git a/src/wayland-egl-tizen/wayland-egl-tizen.c b/src/wayland-egl-tizen/wayland-egl-tizen.c index b4e679c..2fb876c 100644 --- a/src/wayland-egl-tizen/wayland-egl-tizen.c +++ b/src/wayland-egl-tizen/wayland-egl-tizen.c @@ -3,9 +3,6 @@ #include "wayland-egl-tizen.h" #include "wayland-egl-tizen-priv.h" -#define WL_EGL_DEBUG 1 -#if WL_EGL_DEBUG - #include #include #include @@ -13,41 +10,16 @@ #include #include -unsigned int wl_egl_log_level; - -/* WL-EGL Log Level - 0:unintialized, 1:initialized(no logging), 2:min log, 3:more log */ -#define WL_EGL_LOG(lvl, f, x...) { \ - if (wl_egl_log_level == 1) { \ - } \ - else if (wl_egl_log_level > 1) { \ - if (wl_egl_log_level <= lvl) \ - WL_EGL_LOG_PRINT(f, ##x) \ - } \ - else { \ - char *env = getenv("WL_EGL_LOG_LEVEL"); \ - if (env == NULL) \ - wl_egl_log_level = 1; \ - else \ - wl_egl_log_level = atoi(env); \ - \ - if (wl_egl_log_level > 1 && wl_egl_log_level <= lvl)\ - WL_EGL_LOG_PRINT(f, ##x) \ - } \ - } +#define LOG_TAG "WL_EGL" +#include -#define WL_EGL_LOG_PRINT(fmt, args...) { \ - printf("[\x1b[32mWL-EGL\x1b[0m %d:%d|\x1b[32m%s\x1b[0m|%d] " fmt "\n", \ - getpid(), (int)syscall(SYS_gettid), __func__, __LINE__, ##args); \ - } - -#define WL_EGL_ERR(f, x...) { \ - printf("[\x1b[31mWL-EGL_ERR\x1b[0m %d:%d|\x1b[31m%s\x1b[0m|%d] " f "\n",\ - getpid(), (int)syscall(SYS_gettid), __func__, __LINE__, ##x); \ - } +#define FONT_DEFAULT "\033[0m" /* for reset to default color */ +#define FONT_RED "\033[31m" /* for error logs */ +#define FONT_YELLOW "\033[33m" /* for warning logs */ -#else -#define WL_EGL_LOG(lvl, f, x...) -#endif +#define WL_EGL_LOG(f, x...) LOGI(f, ##x) +#define WL_EGL_ERR(f, x...) LOGE(FONT_RED f FONT_DEFAULT, ##x) +#define WL_EGL_WARN(f, x...) LOGW(FONT_YELLOW f FONT_DEFAULT, ##x) void wl_egl_window_tizen_set_rotation(struct wl_egl_window *egl_window, @@ -72,8 +44,8 @@ wl_egl_window_tizen_set_rotation(struct wl_egl_window *egl_window, } if (private->rotation == rotation) { - WL_EGL_LOG(2, "rotation(%d) egl_window->rotation(%d) already rotated", - rotation, private->rotation); + WL_EGL_WARN("wl_egl_window(%p) rotation(%d) already rotated", + egl_window, rotation); return; } @@ -137,9 +109,8 @@ wl_egl_window_tizen_set_buffer_transform(struct wl_egl_window *egl_window, } if (private->transform == wl_output_transform) { - WL_EGL_LOG(2, - "wl_output_transform(%d) private->transform(%d) already rotated", - wl_output_transform, private->transform); + WL_EGL_WARN("wl_egl_window(%p) wl_output_transform(%d) already rotated", + egl_window, wl_output_transform); return; } @@ -198,9 +169,8 @@ wl_egl_window_tizen_set_window_transform(struct wl_egl_window *egl_window, } if (private->window_transform == window_transform) { - WL_EGL_LOG(2, - "window_transform(%d) already rotated", - window_transform); + WL_EGL_WARN("wl_egl_window(%p) window_transform(%d) already rotated", + egl_window, window_transform); return; }