From 514ed5bad1f0967066f4be906138cd29d2cba0ee Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 3 Sep 2012 21:57:37 +0000 Subject: [PATCH] e/connman: use only one log domain SVN revision: 76024 --- src/modules/connman/E_Connman.h | 2 ++ src/modules/connman/Makefile.am | 2 +- src/modules/connman/e_connman.c | 15 ++------------- src/modules/connman/e_connman_private.h | 19 ++++--------------- src/modules/connman/e_mod_main.h | 6 ------ src/modules/connman/log.h | 14 ++++++++++++++ 6 files changed, 23 insertions(+), 35 deletions(-) create mode 100644 src/modules/connman/log.h diff --git a/src/modules/connman/E_Connman.h b/src/modules/connman/E_Connman.h index e22034fa1..67da020c6 100644 --- a/src/modules/connman/E_Connman.h +++ b/src/modules/connman/E_Connman.h @@ -8,6 +8,8 @@ #include #include +#include "log.h" + /* Ecore Events */ extern int E_CONNMAN_EVENT_MANAGER_IN; extern int E_CONNMAN_EVENT_MANAGER_OUT; diff --git a/src/modules/connman/Makefile.am b/src/modules/connman/Makefile.am index 431711468..1d00a509c 100644 --- a/src/modules/connman/Makefile.am +++ b/src/modules/connman/Makefile.am @@ -25,7 +25,7 @@ module_la_SOURCES = e_mod_main.h \ e_mod_main.c \ e_mod_config.c \ e_connman.c \ - e_connman_private.h \ + log.h \ E_Connman.h module_la_LIBADD = @e_libs@ @dlopen_libs@ @ECONNMAN_LIBS@ diff --git a/src/modules/connman/e_connman.c b/src/modules/connman/e_connman.c index de44b8d83..30c58db09 100644 --- a/src/modules/connman/e_connman.c +++ b/src/modules/connman/e_connman.c @@ -2,10 +2,11 @@ #include "config.h" #endif -#include "e_connman_private.h" #include #include +#include "E_Connman.h" + #define CONNMAN_BUS_NAME "net.connman" #define CONNMAN_MANAGER_IFACE CONNMAN_BUS_NAME ".Manager" @@ -27,8 +28,6 @@ static E_DBus_Connection *conn; EAPI int E_CONNMAN_EVENT_MANAGER_IN; EAPI int E_CONNMAN_EVENT_MANAGER_OUT; -int _e_dbus_connman_log_dom = -1; - static inline void _e_connman_system_name_owner_exit(void) { @@ -124,15 +123,6 @@ e_connman_system_init(E_DBus_Connection *edbus_conn) if (init_count > 1) return init_count; - _e_dbus_connman_log_dom = eina_log_domain_register("e_dbus_connman", - EINA_LOG_DEFAULT_COLOR); - - if (_e_dbus_connman_log_dom < 0) - { - EINA_LOG_ERR("impossible to create a log domain for edbus_connman module"); - return -1; - } - E_CONNMAN_EVENT_MANAGER_IN = ecore_event_type_new(); E_CONNMAN_EVENT_MANAGER_OUT = ecore_event_type_new(); @@ -182,7 +172,6 @@ e_connman_system_shutdown(void) memset(&handlers, 0, sizeof(handlers)); - eina_log_domain_unregister(_e_dbus_connman_log_dom); conn = NULL; E_CONNMAN_EVENT_MANAGER_OUT = 0; diff --git a/src/modules/connman/e_connman_private.h b/src/modules/connman/e_connman_private.h index 0e3261c49..791cd2869 100644 --- a/src/modules/connman/e_connman_private.h +++ b/src/modules/connman/e_connman_private.h @@ -1,21 +1,10 @@ -#include +#ifndef _E_CONNMAN_PRIVATE_H_ +#define _E_CONNMAN_PRIVATE_H_ +#include #include #include + #include "E_Connman.h" -extern int _e_dbus_connman_log_dom; - -#ifndef EINA_LOG_DEFAULT_COLOR -#define EINA_LOG_DEFAULT_COLOR EINA_COLOR_CYAN #endif - -#undef DBG -#undef INF -#undef WRN -#undef ERR - -#define DBG(...) EINA_LOG_DOM_DBG(_e_dbus_connman_log_dom, __VA_ARGS__) -#define INF(...) EINA_LOG_DOM_INFO(_e_dbus_connman_log_dom, __VA_ARGS__) -#define WRN(...) EINA_LOG_DOM_WARN(_e_dbus_connman_log_dom, __VA_ARGS__) -#define ERR(...) EINA_LOG_DOM_ERR(_e_dbus_connman_log_dom, __VA_ARGS__) diff --git a/src/modules/connman/e_mod_main.h b/src/modules/connman/e_mod_main.h index 0c77718fd..274a3357b 100644 --- a/src/modules/connman/e_mod_main.h +++ b/src/modules/connman/e_mod_main.h @@ -10,12 +10,6 @@ #define MOD_CONF_VERSION 3 extern int _e_connman_log_dom; -#undef DBG -#undef WRN -#undef ERR -#define DBG(...) EINA_LOG_DOM_DBG(_e_connman_log_dom, __VA_ARGS__) -#define WRN(...) EINA_LOG_DOM_WARN(_e_connman_log_dom, __VA_ARGS__) -#define ERR(...) EINA_LOG_DOM_ERR(_e_connman_log_dom, __VA_ARGS__) typedef struct E_Connman_Instance E_Connman_Instance; typedef struct E_Connman_Module_Context E_Connman_Module_Context; diff --git a/src/modules/connman/log.h b/src/modules/connman/log.h new file mode 100644 index 000000000..f8f6db78a --- /dev/null +++ b/src/modules/connman/log.h @@ -0,0 +1,14 @@ +#ifndef _E_CONNMAN_LOG_H_ +#define _E_CONNMAN_LOG_H_ + +extern int _e_connman_log_dom; + +#undef DBG +#undef WRN +#undef ERR + +#define DBG(...) EINA_LOG_DOM_DBG(_e_connman_log_dom, __VA_ARGS__) +#define WRN(...) EINA_LOG_DOM_WARN(_e_connman_log_dom, __VA_ARGS__) +#define ERR(...) EINA_LOG_DOM_ERR(_e_connman_log_dom, __VA_ARGS__) + +#endif