From: Seunghun Lee Date: Thu, 2 Jun 2016 00:45:31 +0000 (+0900) Subject: Use eina_log for dbg messages. X-Git-Tag: submit/tizen/20160602.020453~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8bd3a71c0dfa5d2fea7a89c8617d73b7e746dcbf;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git Use eina_log for dbg messages. the name of domain is 'wl-textinput'. Change-Id: I7fc47f215e613d87b6dffc244e8df1cc3180df50 --- diff --git a/src/Makefile.am b/src/Makefile.am index 8d8b5e8..49cf309 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,8 @@ filesdir = $(libdir)/enlightenment/modules/$(MODULE) pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH) pkg_LTLIBRARIES = module.la module_la_SOURCES = e_mod_main.c \ - e_mod_input_panel.c + e_mod_input_panel.c \ + wti_log.c module_la_LIBADD = module_la_CFLAGS = @WAYLAND_CFLAGS@ @ENLIGHTENMENT_CFLAGS@ @EEZE_CFLAGS@ @VCONF_CFLAGS@ -DHAVE_WAYLAND_ONLY -DHAVE_WAYLAND module_la_LDFLAGS = -module -avoid-version @WAYLAND_LIBS@ @ENLIGHTENMENT_LIBS@ @EEZE_LIBS@ @VCONF_LIBS@ diff --git a/src/e_mod_main.c b/src/e_mod_main.c index 516c4d1..e519122 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -1511,6 +1511,9 @@ e_modapi_init(E_Module *m) { if (!e_comp_wl) return NULL; + if (!wti_log_init()) + return NULL; + /* FIXME: create only one input method object per seat. */ if (!_e_text_input_method_create()) return NULL; @@ -1554,6 +1557,8 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED) e_input_panel_shutdown(); + wti_log_shutdown(); + return 1; } diff --git a/src/e_mod_main.h b/src/e_mod_main.h index 29ca503..a1396df 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -1,6 +1,8 @@ #ifndef _E_MOD_MAIN_H #define _E_MOD_MAIN_H +#include "wti_log.h" + Eina_Bool e_input_panel_init(void); void e_input_panel_shutdown(void); void e_input_panel_visibility_change(Eina_Bool visible); diff --git a/src/wti_log.c b/src/wti_log.c new file mode 100644 index 0000000..0190174 --- /dev/null +++ b/src/wti_log.c @@ -0,0 +1,24 @@ +#include "wti_log.h" + +const char *domain = "wl-textinput"; +int _wti_log_domain = -1; + +EINTERN Eina_Bool +wti_log_init(void) +{ + _wti_log_domain = eina_log_domain_register(domain, EINA_COLOR_LIGHTCYAN); + if (_wti_log_domain < 0) + { + EINA_LOG_ERR("Unable to register '%s' log domain", domain); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +EINTERN void +wti_log_shutdown(void) +{ + eina_log_domain_unregister(_wti_log_domain); + _wti_log_domain = -1; +} diff --git a/src/wti_log.h b/src/wti_log.h new file mode 100644 index 0000000..566d4f9 --- /dev/null +++ b/src/wti_log.h @@ -0,0 +1,32 @@ +#ifndef _WTI_LOG_H_ +#define _WTI_LOG_H_ + +#include + +#ifdef DBG +#undef DBG +#endif +#ifdef INF +#undef INF +#endif +#ifdef WRN +#undef WRN +#endif +#ifdef ERR +#undef ERR +#endif +#ifdef CRI +#undef CRI +#endif + +extern EINTERN int _wti_log_domain; +#define DBG(...) EINA_LOG_DOM_DBG(_wti_log_domain, __VA_ARGS__) +#define INF(...) EINA_LOG_DOM_INFO(_wti_log_domain, __VA_ARGS__) +#define WRN(...) EINA_LOG_DOM_WARN(_wti_log_domain, __VA_ARGS__) +#define ERR(...) EINA_LOG_DOM_ERR(_wti_log_domain, __VA_ARGS__) +#define CRI(...) EINA_LOG_DOM_CRIT(_wti_log_domain, __VA_ARGS__) + +EINTERN Eina_Bool wti_log_init(void); +EINTERN void wti_log_shutdown(void); + +#endif