forked from enlightenment/edi
Fix logging so the bin is not trying to access the private lib domain - fixes build issues
This commit is contained in:
parent
82d87e2578
commit
de9b02ae6e
|
@ -40,6 +40,7 @@ static Elm_Object_Item *_edi_selected_bottompanel;
|
|||
static Evas_Object *_edi_filepanel, *_edi_filepanel_icon;
|
||||
|
||||
static Evas_Object *_edi_main_win, *_edi_new_popup, *_edi_goto_popup;
|
||||
int _edi_log_dom = -1;
|
||||
|
||||
static void
|
||||
_edi_file_open_cb(const char *path, const char *type, Eina_Bool newwin)
|
||||
|
@ -740,6 +741,26 @@ edi_close()
|
|||
elm_exit();
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_edi_log_init()
|
||||
{
|
||||
_edi_log_dom = eina_log_domain_register("edi", EINA_COLOR_GREEN);
|
||||
if (_edi_log_dom < 0)
|
||||
{
|
||||
EINA_LOG_ERR("Edi can not create its log domain.");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_edi_log_shutdown()
|
||||
{
|
||||
eina_log_domain_unregister(_edi_log_dom);
|
||||
_edi_log_dom = -1;
|
||||
}
|
||||
|
||||
static const Ecore_Getopt optdesc = {
|
||||
"edi",
|
||||
"%prog [options] [project-dir]",
|
||||
|
@ -784,6 +805,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
|||
goto config_error;
|
||||
|
||||
edi_init();
|
||||
if (!_edi_log_init())
|
||||
goto end;
|
||||
|
||||
args = ecore_getopt_parse(&optdesc, values, argc, argv);
|
||||
if (args < 0)
|
||||
|
@ -814,6 +837,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
|||
elm_run();
|
||||
|
||||
end:
|
||||
_edi_log_shutdown();
|
||||
elm_shutdown();
|
||||
edi_shutdown();
|
||||
|
||||
|
|
|
@ -3,28 +3,28 @@
|
|||
|
||||
#include <Evas.h>
|
||||
|
||||
extern int _edi_lib_log_dom;
|
||||
extern int _edi_log_dom;
|
||||
|
||||
#ifdef CRIT
|
||||
# undef CRIT
|
||||
#endif
|
||||
#define CRIT(...) EINA_LOG_DOM_CRIT(_edi_lib_log_dom, __VA_ARGS__)
|
||||
#define CRIT(...) EINA_LOG_DOM_CRIT(_edi_log_dom, __VA_ARGS__)
|
||||
#ifdef ERR
|
||||
# undef ERR
|
||||
#endif
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_edi_lib_log_dom, __VA_ARGS__)
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_edi_log_dom, __VA_ARGS__)
|
||||
#ifdef WRN
|
||||
# undef WRN
|
||||
#endif
|
||||
#define WRN(...) EINA_LOG_DOM_WARN(_edi_lib_log_dom, __VA_ARGS__)
|
||||
#define WRN(...) EINA_LOG_DOM_WARN(_edi_log_dom, __VA_ARGS__)
|
||||
#ifdef INF
|
||||
# undef INF
|
||||
#endif
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_edi_lib_log_dom, __VA_ARGS__)
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_edi_log_dom, __VA_ARGS__)
|
||||
#ifdef DBG
|
||||
# undef DBG
|
||||
#endif
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_edi_lib_log_dom, __VA_ARGS__)
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_edi_log_dom, __VA_ARGS__)
|
||||
|
||||
#define EDI_CONTENT_AUTOSAVE EINA_TRUE
|
||||
|
||||
|
|
|
@ -22,12 +22,13 @@ edi_init(void)
|
|||
|
||||
eina_init();
|
||||
|
||||
_edi_lib_log_dom = eina_log_domain_register("edi", EINA_COLOR_CYAN);
|
||||
_edi_lib_log_dom = eina_log_domain_register("edi-lib", EINA_COLOR_CYAN);
|
||||
if (_edi_lib_log_dom < 0)
|
||||
{
|
||||
EINA_LOG_ERR("Edi can not create its log domain.");
|
||||
EINA_LOG_ERR("Edi lib cannot create its log domain.");
|
||||
goto shutdown_eina;
|
||||
}
|
||||
INF("Edi library loaded");
|
||||
|
||||
// Put here your initialization logic of your library
|
||||
|
||||
|
@ -52,6 +53,8 @@ edi_shutdown(void)
|
|||
EINA_LOG_STATE_START,
|
||||
EINA_LOG_STATE_SHUTDOWN);
|
||||
|
||||
INF("Edi library shut down");
|
||||
|
||||
// Put here your shutdown logic
|
||||
|
||||
eina_log_domain_unregister(_edi_lib_log_dom);
|
||||
|
|
Loading…
Reference in New Issue