summaryrefslogtreecommitdiff
path: root/legacy/ethumb
diff options
context:
space:
mode:
authorIván Briano <sachieru@gmail.com>2010-07-01 19:48:54 +0000
committerIván Briano <sachieru@gmail.com>2010-07-01 19:48:54 +0000
commit8e50bcb41b0a77893da0af8fc6339f70120bc44b (patch)
treeac50a8c26dd39c45a5fb7e274e7fa51e9db963b2 /legacy/ethumb
parent01b6434842eb81448a002258b2113335753a878e (diff)
More from Raphael Kubo, register log domains
SVN revision: 49975
Diffstat (limited to '')
-rw-r--r--legacy/ethumb/src/bin/ethumbd.c29
-rw-r--r--legacy/ethumb/src/bin/ethumbd_child.c27
2 files changed, 47 insertions, 9 deletions
diff --git a/legacy/ethumb/src/bin/ethumbd.c b/legacy/ethumb/src/bin/ethumbd.c
index b2f217e43b..31cc593bad 100644
--- a/legacy/ethumb/src/bin/ethumbd.c
+++ b/legacy/ethumb/src/bin/ethumbd.c
@@ -44,11 +44,11 @@
44 44
45#define MAX_ID 2000000 45#define MAX_ID 2000000
46 46
47#define DBG(...) EINA_LOG_DBG(__VA_ARGS__) 47#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
48#define INF(...) EINA_LOG_INFO(__VA_ARGS__) 48#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
49#define WRN(...) EINA_LOG_WARN(__VA_ARGS__) 49#define WRN(...) EINA_LOG_DOM_WARN(_log_domain, __VA_ARGS__)
50#define ERR(...) EINA_LOG_ERR(__VA_ARGS__) 50#define ERR(...) EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__)
51#define CRIT(...) EINA_LOG_CRIT(__VA_ARGS__) 51#define CRIT(...) EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__)
52 52
53static const char _ethumb_dbus_bus_name[] = "org.enlightenment.Ethumb"; 53static const char _ethumb_dbus_bus_name[] = "org.enlightenment.Ethumb";
54static const char _ethumb_dbus_interface[] = "org.enlightenment.Ethumb"; 54static const char _ethumb_dbus_interface[] = "org.enlightenment.Ethumb";
@@ -58,6 +58,8 @@ static const char fdo_interface[] = "org.freedesktop.DBus";
58static const char fdo_bus_name[] = "org.freedesktop.DBus"; 58static const char fdo_bus_name[] = "org.freedesktop.DBus";
59static const char fdo_path[] = "/org/freedesktop/DBus"; 59static const char fdo_path[] = "/org/freedesktop/DBus";
60 60
61static int _log_domain = -1;
62
61struct _Ethumb_Setup 63struct _Ethumb_Setup
62{ 64{
63 struct 65 struct
@@ -1810,6 +1812,17 @@ main(int argc, char *argv[])
1810 1812
1811 ethumb_init(); 1813 ethumb_init();
1812 1814
1815 if (_log_domain < 0)
1816 {
1817 _log_domain = eina_log_domain_register("ethumbd", NULL);
1818 if (_log_domain < 0)
1819 {
1820 EINA_LOG_CRIT("could not register log domain 'ethumbd'");
1821 exit_value = -7;
1822 goto finish;
1823 }
1824 }
1825
1813 child = _ethumbd_slave_spawn(&ed); 1826 child = _ethumbd_slave_spawn(&ed);
1814 if (!child) 1827 if (!child)
1815 { 1828 {
@@ -1872,6 +1885,12 @@ main(int argc, char *argv[])
1872 _ethumb_dbus_finish(&ed); 1885 _ethumb_dbus_finish(&ed);
1873 1886
1874 finish_edbus: 1887 finish_edbus:
1888 if (_log_domain >= 0)
1889 {
1890 eina_log_domain_unregister(_log_domain);
1891 _log_domain = -1;
1892 }
1893
1875 e_dbus_shutdown(); 1894 e_dbus_shutdown();
1876 finish: 1895 finish:
1877 if (ed.slave.exe) 1896 if (ed.slave.exe)
diff --git a/legacy/ethumb/src/bin/ethumbd_child.c b/legacy/ethumb/src/bin/ethumbd_child.c
index e8e80fdfb4..9aa660cd82 100644
--- a/legacy/ethumb/src/bin/ethumbd_child.c
+++ b/legacy/ethumb/src/bin/ethumbd_child.c
@@ -36,13 +36,15 @@
36 36
37#include "ethumbd_private.h" 37#include "ethumbd_private.h"
38 38
39#define DBG(...) EINA_LOG_DBG(__VA_ARGS__) 39#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
40#define INF(...) EINA_LOG_INFO(__VA_ARGS__) 40#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
41#define WRN(...) EINA_LOG_WARN(__VA_ARGS__) 41#define WRN(...) EINA_LOG_DOM_WARN(_log_domain, __VA_ARGS__)
42#define ERR(...) EINA_LOG_ERR(__VA_ARGS__) 42#define ERR(...) EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__)
43 43
44#define NETHUMBS 100 44#define NETHUMBS 100
45 45
46static int _log_domain = -1;
47
46struct _Ethumbd_Child 48struct _Ethumbd_Child
47{ 49{
48 Ecore_Fd_Handler *fd_handler; 50 Ecore_Fd_Handler *fd_handler;
@@ -710,6 +712,18 @@ main(int argc, const char *argv[])
710 712
711 ethumb_init(); 713 ethumb_init();
712 714
715 if (_log_domain < 0)
716 {
717 _log_domain = eina_log_domain_register("ethumbd_child", NULL);
718
719 if (_log_domain < 0)
720 {
721 EINA_LOG_CRIT("could not register log domain 'ethumbd_child'");
722 ethumb_shutdown();
723 return 1;
724 }
725 }
726
713 ec = _ec_new(); 727 ec = _ec_new();
714 728
715 _ec_setup(ec); 729 _ec_setup(ec);
@@ -720,6 +734,11 @@ main(int argc, const char *argv[])
720 734
721 _ec_free(ec); 735 _ec_free(ec);
722 736
737 if (_log_domain >= 0)
738 {
739 eina_log_domain_unregister(_log_domain);
740 _log_domain = -1;
741 }
723 ethumb_shutdown(); 742 ethumb_shutdown();
724 743
725 return 0; 744 return 0;