#include "wayland-egl-tizen.h"
#include "wayland-egl-tizen-priv.h"
-#define WL_EGL_DEBUG 1
-#if WL_EGL_DEBUG
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
-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 <dlog.h>
-#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,
}
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;
}
}
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;
}
}
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;
}