From 0d5317b222969ffab15858740d11de265b8dea9f Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Sat, 6 Mar 2010 14:15:00 +0000 Subject: [PATCH] 'everything' add log domain SVN revision: 46908 --- src/modules/everything/Evry.h | 20 ++++++++++++++++++-- src/modules/everything/e_mod_main.c | 13 +++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/modules/everything/Evry.h b/src/modules/everything/Evry.h index 2aaf21fb6..0f472a261 100644 --- a/src/modules/everything/Evry.h +++ b/src/modules/everything/Evry.h @@ -7,6 +7,21 @@ #define EVRY_ASYNC_UPDATE_ADD 0 #define EVRY_ASYNC_UPDATE_CLEAR 1 +extern int _e_module_evry_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_module_evry_log_dom , __VA_ARGS__) +#define INF(...) EINA_LOG_DOM_INFO(_e_module_evry_log_dom , __VA_ARGS__) +#define WRN(...) EINA_LOG_DOM_WARN(_e_module_evry_log_dom , __VA_ARGS__) +#define ERR(...) EINA_LOG_DOM_ERR(_e_module_evry_log_dom , __VA_ARGS__) typedef struct _Evry_Plugin Evry_Plugin; typedef struct _Evry_Item Evry_Item; @@ -48,6 +63,7 @@ typedef struct _Plugin_Config Plugin_Config; evry_plugin_free(EVRY_PLUGIN(_p), 0); \ E_FREE(_p); + struct _Plugin_Config { const char *name; @@ -93,7 +109,7 @@ struct _Evry_Item /* if transient item is removed from history * on shutdown */ Eina_Bool transient; - + /* do not set by plugin! */ Evry_Item *next; Evry_Plugin *plugin; @@ -176,7 +192,7 @@ struct _Evry_State Evry_Item *cur_item; Eina_List *sel_items; - + /* this is for the case when the current plugin was not selected manually and a higher priority (async) plugin retrieves candidates, the higher priority plugin is made current */ diff --git a/src/modules/everything/e_mod_main.c b/src/modules/everything/e_mod_main.c index 0d0501b1f..3f4ec340d 100644 --- a/src/modules/everything/e_mod_main.c +++ b/src/modules/everything/e_mod_main.c @@ -26,6 +26,9 @@ static Eina_Array *plugins = NULL; static E_Config_DD *conf_edd = NULL; static E_Config_DD *conf_item_edd = NULL; +int _e_module_evry_log_dom = -1; + + EAPI Config *evry_conf = NULL; @@ -56,6 +59,16 @@ e_modapi_init(E_Module *m) * e_user_homedir_get(), e_config_profile_get()); * ecore_file_mkdir(buf); */ + _e_module_evry_log_dom = eina_log_domain_register + ("e_module_everything", EINA_LOG_DEFAULT_COLOR); + + if(_e_module_evry_log_dom < 0) + { + EINA_LOG_ERR + ("impossible to create a log domain for everything module"); + return NULL; + } + _config_init(); evry_history_init();