log: use dlog instead of eina_log 54/241254/2
authorSeunghun Lee <shiin.lee@samsung.com>
Mon, 3 Aug 2020 18:21:00 +0000 (03:21 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 19 Aug 2020 16:45:12 +0000 (01:45 +0900)
Change-Id: I3d77c283cb4754e1bea96098795eb1b095204527

configure.ac
packaging/libpepper-efl.spec
src/lib/Makefile.am
src/lib/compositor.c
src/lib/log.c [deleted file]
src/lib/private.h
src/lib/tizen_policy.c

index f66f681a6e4f391196ffcada288463c7339d11a9..dc8e6d24a873187c15a313963836b77e574f109e 100644 (file)
@@ -25,7 +25,7 @@ PKG_CHECK_MODULES([PEPPER], [pepper pepper-xkb])
 PKG_CHECK_MODULES([WAYLAND], [wayland-server xdg-shell-unstable-v6-server tizen-extension-client])
 PKG_CHECK_MODULES([EFL], [eina ecore ecore-input evas ecore-wl2])
 PKG_CHECK_MODULES([WAYLAND_TBM], [wayland-tbm-server])
-
+PKG_CHECK_MODULES([DLOG], [dlog])
 
 AC_ARG_ENABLE([examples],
    [AS_HELP_STRING([--enable-examples], [build examples, @<:@default=disabled@:>@])],
index 187707171605a0396717d8dd9d5365110542a491..44bc44bc8f5c623d025073c413b2783a86f4f79f 100644 (file)
@@ -18,6 +18,7 @@ BuildRequires: pkgconfig(tizen-extension-client)
 BuildRequires: pkgconfig(ecore-wl2)
 BuildRequires: pkgconfig(wayland-tbm-server)
 BuildRequires: pkgconfig(wayland-tbm-client)
+BuildRequires: pkgconfig(dlog)
 
 Requires: libwayland-extension-server
 Requires: pepper-xkb
index fe40494420ef9b9d82d25adc8fadfecefb9bcaf0..7ad0a2850122b3b01e823481b0111f5ae518b625 100644 (file)
@@ -3,7 +3,7 @@ libpepper_efl_la_LTLIBRARIES = libpepper-efl.la
 AM_CFLAGS = $(GCC_CFLAGS)
 
 libpepper_efl_ladir = $(libdir)
-libpepper_efl_la_LIBADD = @EFL_LIBS@ @WAYLAND_LIBS@ @PEPPER_LIBS@ @WAYLAND_TBM_LIBS@
+libpepper_efl_la_LIBADD = @EFL_LIBS@ @WAYLAND_LIBS@ @PEPPER_LIBS@ @WAYLAND_TBM_LIBS@ @DLOG_LIBS@
 libpepper_efl_la_LDFLAGS = ${LDFLAGS}
 libpepper_efl_la_CPPFLAGS = $(AM_CPPFLAGS)
 libpepper_efl_la_CFLAGS =      \
@@ -12,11 +12,11 @@ libpepper_efl_la_CFLAGS =   \
        @WAYLAND_CFLAGS@                \
        @PEPPER_CFLAGS@                 \
        @WAYLAND_TBM_CFLAGS@    \
+       @DLOG_CFLAGS@                   \
        -I$(top_srcdir)/src
 
 libpepper_efl_la_SOURCES =     \
        compositor.c                    \
-       log.c                                   \
        output.c                                \
        shell.c                                 \
        input.c                                 \
index 15c87cfdfb9e2422ec42282fe11f870a4f77d1da..c6b7f59c9ef8610d38b749ff9ec91c9274881072 100644 (file)
@@ -248,15 +248,11 @@ found:
 static Eina_Bool
 _pepper_efl_compositor_init(void)
 {
-   Eina_Bool res;
-
-   res = pepper_efl_log_init("pepper-efl");
-   if (!res)
+   if (!eina_init())
      {
-        fprintf(stderr, "failed to init log system\n");
-        goto err_log;
+        ERR("failed to init eina");
+        goto err_eina;
      }
-
    if (!ecore_init())
      {
         ERR("failed to init ecore");
@@ -275,8 +271,8 @@ _pepper_efl_compositor_init(void)
 err_hash:
    ecore_shutdown();
 err_ecore:
-   pepper_efl_log_shutdown();
-err_log:
+   eina_shutdown();
+err_eina:
    return EINA_FALSE;
 }
 
@@ -285,7 +281,7 @@ _pepper_efl_compositor_shutdown(void)
 {
    PE_FREE_FUNC(_comp_hash, eina_hash_free);
    ecore_shutdown();
-   pepper_efl_log_shutdown();
+   eina_shutdown();
 }
 
 static pepper_efl_comp_t *
diff --git a/src/lib/log.c b/src/lib/log.c
deleted file mode 100644 (file)
index 77798b5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "private.h"
-
-int         _log_domain = -1;
-static int  _init_count = 0;
-
-int
-pepper_efl_log_init(const char *domain)
-{
-   if (_init_count)
-     goto end;
-
-   if (!eina_init())
-     {
-        fprintf(stderr, "%s:%d - %s() error initializing Eina\n",
-                __FILE__, __LINE__, __func__);
-        return 0;
-     }
-
-   _log_domain = eina_log_domain_register(domain, EINA_COLOR_LIGHTCYAN);
-
-   if (_log_domain < 0)
-     {
-        EINA_LOG_ERR("Unable to register '%s' log domain", domain);
-        eina_shutdown();
-        return 0;
-     }
-
-end:
-   return ++_init_count;
-}
-
-void
-pepper_efl_log_shutdown(void)
-{
-   if ((_init_count <= 0) ||
-       (--_init_count > 0))
-     return;
-
-   eina_log_domain_unregister(_log_domain);
-   eina_shutdown();
-}
index 184d1929ea6c7e8e26d3075f42625eb68baf7132..54ec1dfca72c8e5c481d23f73fefd982f22dfb14 100644 (file)
@@ -14,6 +14,8 @@
 #include <wayland-server.h>
 #include <wayland-tbm-server.h>
 
+#include <dlog.h>
+
 typedef struct pepper_efl_comp   pepper_efl_comp_t;
 typedef struct pepper_efl_output pepper_efl_output_t;
 typedef struct pepper_efl_input  pepper_efl_input_t;
@@ -85,16 +87,15 @@ struct pepper_efl_comp
 # define PE_CHECK_RET(x, ret)    EINA_SAFETY_ON_NULL_RETURN_VAL(x, ret)
 #endif
 
-extern int _log_domain;
-
-#define DBG(...)  EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
-#define INF(...)  EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
-#define WRN(...)  EINA_LOG_DOM_WARN(_log_domain, __VA_ARGS__)
-#define ERR(...)  EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__)
-#define CRI(...)  EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__)
+#ifdef LOG_TAG
+# undef LOG_TAG
+#endif
+#define LOG_TAG "PEPPER_EFL"
 
-int   pepper_efl_log_init(const char *domain);
-void  pepper_efl_log_shutdown(void);
+#define DBG(format, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, format, ##arg)
+#define INF(format, arg...) dlog_print(DLOG_INFO, LOG_TAG, format, ##arg)
+#define WRN(format, arg...) dlog_print(DLOG_WARN, LOG_TAG, format, ##arg)
+#define ERR(format, arg...) dlog_print(DLOG_ERROR, LOG_TAG, format, ##arg)
 
 pepper_efl_input_t   *pepper_efl_input_create(pepper_efl_comp_t *comp, const char *seat_name);
 void                  pepper_efl_input_destroy(pepper_efl_input_t *seat);
index 7e71451941bf8c90969f24693c4589f5ba52271f..7d52bc328f44160bafecc73d3f8f343a7053af0c 100644 (file)
@@ -28,7 +28,7 @@ _tzpol_surface_unref(tzpol_surface_t *tsurf, struct wl_resource *unref)
    res = wl_list_empty(&tsurf->resource_list);
    if (res)
      {
-        CRI("Couldn't unreference, list is empty");
+        ERR("Couldn't unreference, list is empty");
         return;
      }