Brian Mattern <rephorm@rephorm.com>
+Mathieu Taillefumier <mathieu.taillefumier@free.fr>
#include "E_Hal.h"
#include <config.h>
+#include "e_dbus_private.h"
#if EWL_GUI
#include <Ewl.h>
{
Volume *v;
Eina_List *l;
- printf("storage_free: %s\n", storage->udi);
+ E_DBUS_LOG_INFO("storage_free: %s", storage->udi);
/* disconnect storage from volume */
EINA_LIST_FOREACH(storage->volumes, l, v)
{
Volume *v;
if (!udi) return NULL;
- printf("ADDING %s\n", udi);
+ E_DBUS_LOG_INFO("ADDING %s", udi);
v = volume_new();
v->udi = strdup(udi);
volumes = eina_list_append(volumes, v);
EINA_LIST_FOREACH(ret->strings, l, device)
{
- printf("device: %s\n", device);
+ E_DBUS_LOG_INFO("device: %s", device);
}
}
dbus_error_init(&err);
dbus_message_get_args(msg, &err, DBUS_TYPE_STRING, &udi, DBUS_TYPE_INVALID);
udi = strdup(udi);
- printf("Device added: %s\n", udi);
+ E_DBUS_LOG_INFO("Ehal: Device added: %s", udi);
ret = e_hal_device_query_capability(conn, udi, "storage", cb_is_storage, strdup(udi));
e_hal_device_query_capability(conn, udi, "volume", cb_is_volume, strdup(udi));
}
dbus_error_init(&err);
dbus_message_get_args(msg, &err, DBUS_TYPE_STRING, &udi, DBUS_TYPE_INVALID);
- printf("Removed: %s\n", udi);
+ E_DBUS_LOG_INFO("Removed: %s", udi);
storage_remove(udi);
volume_remove(udi);
}
{
Volume *vol = user_data;
vol->mounted = 0;
- printf("Volume unmounted reply: %s\n", vol->udi);
+ E_DBUS_LOG_INFO("Volume unmounted reply: %s", vol->udi);
}
static void
{
Volume *vol = user_data;
vol->mounted = 1;
- printf("Volume mounted reply: %s\n", vol->udi);
+ E_DBUS_LOG_INFO("Volume mounted reply: %s", vol->udi);
}
static void
Device *dev = data;
char buf[4096];
- printf("Device clicked: %s\n", dev->udi);
+ E_DBUS_LOG_INFO("Device clicked: %s", dev->udi);
if (dev->type == DEVICE_TYPE_VOLUME)
{
Volume *vol = (Volume *)dev;
mount_point = buf;
}
- printf("Attempting to mount %s to %s\n", vol->udi, mount_point);
+ E_DBUS_LOG_INFO("Attempting to mount %s to %s", vol->udi, mount_point);
e_hal_device_volume_mount(conn, vol->udi, mount_point, vol->fstype, NULL, cb_volume_mounted, vol);
}
}
efreet_init();
if (!ewl_init(&argc, argv))
{
- fprintf(stderr, "Unable to init EWL.\n");
+ E_DBUS_LOG_INFO(stderr, "Unable to init EWL.");
return 1;
}
#endif
conn = e_dbus_bus_get(DBUS_BUS_SYSTEM);
if (!conn)
{
- printf("Error connecting to system bus. Is it running?\n");
+ E_DBUS_LOG_INFO(stderr, "Error connecting to system bus. Is it running?");
return 1;
}
else
return FALSE;
- DBG("sync_manager: %s (%s)\n", unique_name, bus_name);
+ DBG("sync_manager: %s (%s)", unique_name, bus_name);
return TRUE;
}
static void
_e_connman_system_name_owner_enter(const char *uid)
{
- DBG("enter connman at %s (old was %s)\n", uid, unique_name);
+ DBG("E-Dbus connman: enter connman at %s (old was %s)", uid, unique_name);
if (unique_name && strcmp(unique_name, uid) == 0)
{
- DBG("same unique_name for connman, ignore.\n");
+ DBG("E-Dbus connman: same unique_name for connman, ignore.");
return;
}
DBUS_TYPE_STRING, &to,
DBUS_TYPE_INVALID))
{
- ERR("could not get NameOwnerChanged arguments: %s: %s\n",
+ ERR("E-Dbus connman: could not get NameOwnerChanged arguments: %s: %s",
err.name, err.message);
dbus_error_free(&err);
return;
if (strcmp(name, bus_name) != 0)
return;
- DBG("NameOwnerChanged from=[%s] to=[%s]\n", from, to);
+ DBG("E-Dbus connman: NameOwnerChanged from=[%s] to=[%s]", from, to);
if (from[0] == '\0' && to[0] != '\0')
_e_connman_system_name_owner_enter(to);
else if (from[0] != '\0' && to[0] == '\0')
{
- DBG("exit connman at %s\n", from);
+ DBG("E-Dbus connman: exit connman at %s", from);
if (strcmp(unique_name, from) != 0)
- DBG("%s was not the known name %s, ignored.\n", from, unique_name);
+ DBG("E-Dbus connman: %s was not the known name %s, ignored.", from, unique_name);
else
_e_connman_system_name_owner_exit();
}
else
- DBG("unknow change from %s to %s\n", from, to);
+ DBG("E-Dbus connman: unknow change from %s to %s", from, to);
}
static void
dbus_message_iter_get_basic(&itr, &uid);
if (!uid)
{
- ERR("no name owner!\n");
+ ERR("E-Dbus connman: no name owner!");
return;
}
if (init_count > 1)
return init_count;
+
+ _e_dbus_connman_log_dom = eina_log_domain_register("e_dbus_connman",EINA_LOG_DEFAULT_COLOR);
- if (!eina_init())
- fputs("ERROR: Error during the initialization of eina.\n", stderr);
+ if(_e_dbus_connman_log_dom < 0)
+ {
+ E_DBUS_LOG_ERR("E-Dbus connman error : impossible to create a log domain for edbus_connman module");
+ return -1;
+ }
if (E_CONNMAN_EVENT_MANAGER_IN == 0)
E_CONNMAN_EVENT_MANAGER_IN = ecore_event_type_new();
{
if (init_count == 0)
{
- fputs("ERROR: connman system already shutdown.\n", stderr);
+ E_DBUS_LOG_ERR("E-Dbus connman Error: connman system already shut down.");
return 0;
}
init_count--;
_e_connman_system_name_owner_exit();
e_connman_elements_shutdown();
- eina_shutdown();
+ eina_log_domain_unregister(_e_dbus_connman_log_dom);
e_connman_conn = NULL;
return init_count;
if (!e_connman_element_is_connection(connection))
{
- WRN("path '%s' is not a connection!\n", path);
+ WRN("path '%s' is not a connection!", path);
return NULL;
}
if (!e_connman_element_is_device(device))
{
- WRN("path '%s' is not a device!\n", path);
+ WRN("E-Dbus connman: path '%s' is not a device!", path);
return NULL;
}
static void
_e_connman_device_network_create_callback(void *user_data, DBusMessage *msg, DBusError *err)
{
- WRN("FIXME need to receive the network object path\n");
+ WRN("E-Dbus connman: FIXME need to receive the network object path");
}
/**
if (!element)
{
- ERR("safety check failed: element == NULL\n");
+ ERR("E-Dbus connman: safety check failed: element == NULL");
goto error;
}
if (!cb)
{
- ERR("safety check failed: cb == NULL\n");
+ ERR("E-Dbus connman: safety check failed: cb == NULL");
goto error;
}
l = malloc(sizeof(*l));
if (!l)
{
- ERR("could not allocate E_Connman_Element_Listener\n");
+ ERR("E-Dbus connman: could not allocate E_Connman_Element_Listener");
goto error;
}
_e_connman_element_array_free(property->value.array, NULL);
break;
default:
- ERR("don't know how to free value of property type %c (%d)\n",
+ ERR("E-Dbus connman: don't know how to free value of property type %c (%d)",
property->type, property->type);
}
}
}
if (!interface)
- ERR("connman reported unknown interface: %s\n", key);
+ ERR("E-Dbus connman: connman reported unknown interface: %s", key);
return interface;
}
return;
element = e_connman_element_register(item, interface);
if ((element) && (!e_connman_element_properties_sync(element)))
- WRN("could not get properties of %s\n", element->path);
+ WRN("E-Dbus connman: could not get properties of %s", element->path);
}
static void
if (property->type != type)
{
if (property->type)
- DBG("property type changed from '%c' to '%c'\n",
+ DBG("E-Dbus connman: property type changed from '%c' to '%c'",
property->type, type);
_e_connman_element_property_value_free(property);
memset(&property->value, 0, sizeof(property->value));
changed = 1;
break;
default:
- ERR("don't know how to update property type %c (%d)\n", type, type);
+ ERR("E-Dbus connman: don't know how to update property type %c (%d)", type, type);
}
return changed;
if (!property)
{
eina_stringshare_del(name);
- ERR("could not allocate property: %s\n", strerror(errno));
+ ERR("E-Dbus connman: could not allocate property: %s", strerror(errno));
return NULL;
}
ret = malloc(*count * sizeof(unsigned char));
if (!ret)
{
- ERR("could not allocate return array of %d bytes: %s\n",
+ ERR("E-Dbus connman: could not allocate return array of %d bytes: %s",
*count, strerror(errno));
return NULL;
}
if (type != DBUS_TYPE_ARRAY)
{
- ERR("property %s is not an array!\n", property);
+ ERR("E-Dbus connman: property %s is not an array!", property);
return 0;
}
if (array->type != DBUS_TYPE_OBJECT_PATH)
{
- ERR("property %s is not an array of object paths!\n", property);
+ ERR("E-Dbus connman: property %s is not an array of object paths!", property);
return 0;
}
ret = malloc(*count * sizeof(E_Connman_Element *));
if (!ret)
{
- ERR("could not allocate return array of %d elements: %s\n",
+ ERR("E-Dbus connman: could not allocate return array of %d elements: %s",
*count, strerror(errno));
*count = 0;
return 0;
EINA_SAFETY_ON_NULL_RETURN(fp);
if (!element)
{
- fputs("ERROR: no element to print\n", fp);
+ fputs("Error: no element to print\n", fp);
return;
}
element = calloc(1, sizeof(*element));
if (!element)
{
- ERR("could not allocate element: %s\n", strerror(errno));
+ ERR("E-Dbus connman: could not allocate element: %s", strerror(errno));
return NULL;
}
if (i == 0)
e_connman_element_free(element);
else if (i < 0)
- ERR("element %p references %d < 0\n", element, i);
+ ERR("E-Dbus connman: element %p references %d < 0", element, i);
return i;
}
data = malloc(sizeof(*data));
if (!data)
{
- ERR("could not alloc e_connman_element_call_data: %s\n",
+ ERR("E-Dbus connman: could not alloc e_connman_element_call_data: %s",
strerror(errno));
dbus_message_unref(msg);
return 0;
p = malloc(sizeof(*p));
if (!p)
{
- ERR("could not alloc E_Connman_Element_Pending: %s\n",
+ ERR("E-Dbus connman: could not alloc E_Connman_Element_Pending: %s",
strerror(errno));
free(data);
dbus_message_unref(msg);
}
else
{
- ERR("failed to call %s (obj=%s, path=%s, iface=%s)\n",
+ ERR("E-Dbus connman: failed to call %s (obj=%s, path=%s, iface=%s)",
method_name, e_connman_system_bus_name_get(),
element->path, element->interface);
free(data);
p = _e_connman_element_property_new(name, type, value);
if (!p)
{
- ERR("could not create property %s (%c)\n", name, type);
+ ERR("E-Dbus connman: could not create property %s (%c)", name, type);
return 0;
}
array = malloc(sizeof(E_Connman_Array));
if (!array)
{
- ERR("could not create new e_connman array.\n");
+ ERR("E-Dbus connman: could not create new e_connman array.");
return NULL;
}
array->array = eina_array_new(16);
if (!(array->array))
{
- ERR("could not create new eina array.\n");
+ ERR("E-Dbus connman: could not create new eina array.");
free(array);
return NULL;
}
}
break;
default:
- ERR("don't know how to get property type %c (%d)\n",
+ ERR("E-Dbus connman: don't know how to get property type %c (%d)",
array->type, array->type);
}
}
DBusMessageIter itr, s_itr;
int t, changed;
- DBG("get_properties msg=%p\n", msg);
+ DBG("E-Dbus connman: get_properties msg=%p", msg);
if (!_dbus_callback_check_and_init(msg, &itr, err))
return;
dbus_message_iter_get_basic(&v_itr, &value);
r = _e_connman_element_property_value_add(element, key, t, value);
if (r < 0)
- ERR("failed to add property value %s (%c)\n", key, t);
+ ERR("E-Dbus connman: failed to add property value %s (%c)", key, t);
else if (r == 1)
{
- INF("property value changed %s (%c)\n", key, t);
+ INF("E-Dbus connman: property value changed %s (%c)", key, t);
changed = 1;
}
}
}
}
- WRN("element %s (%p) has no property with name \"%s\".\n",
+ WRN("E-Dbus connman: element %s (%p) has no property with name \"%s\".",
element->path, element, name);
return 0;
}
value = &p->value.u32;
break;
default:
- ERR("unsupported type %c\n", p->type);
+ ERR("E-Dbus connman: unsupported type %c", p->type);
}
if (!cb((void *)data, element, p->name, p->type, value))
*(E_Connman_Array **)value = p->value.array;
return 1;
default:
- ERR("don't know how to get property type %c (%d)\n",
+ ERR("E-Dbus connman: don't know how to get property type %c (%d)",
p->type, p->type);
return 0;
}
}
- WRN("element %s (%p) has no property with name \"%s\".\n",
+ WRN("E-Dbus connman: element %s (%p) has no property with name \"%s\".",
element->path, element, name);
return 0;
}
*p_elements = malloc(*count * sizeof(E_Connman_Element *));
if (!*p_elements)
{
- ERR("could not allocate return array of %d elements: %s\n",
+ ERR("E-Dbus connman: could not allocate return array of %d elements: %s",
*count, strerror(errno));
*count = 0;
return 0;
const char *name;
void *value;
- DBG("Property changed in element %s\n", element->path);
+ DBG("E-Dbus connman: Property changed in element %s", element->path);
if (!_dbus_callback_check_and_init(msg, &itr, NULL))
return;
t = dbus_message_iter_get_arg_type(&itr);
if (!_dbus_iter_type_check(t, DBUS_TYPE_STRING))
- ERR("missing name in property changed signal\n");
+ ERR("E-Dbus connman: missing name in property changed signal");
dbus_message_iter_get_basic(&itr, &name);
dbus_message_iter_next(&itr);
t = dbus_message_iter_get_arg_type(&itr);
if (!_dbus_iter_type_check(t, DBUS_TYPE_VARIANT))
- ERR("missing value in property changed signal\n");
+ ERR("E-Dbus connman: missing value in property changed signal");
dbus_message_iter_recurse(&itr, &v_itr);
t = dbus_message_iter_get_arg_type(&v_itr);
dbus_message_iter_get_basic(&v_itr, &value);
r = _e_connman_element_property_value_add(element, name, t, value);
if (r < 0)
- ERR("failed to add property value %s (%c)\n", name, t);
+ ERR("E-Dbus connman: failed to add property value %s (%c)", name, t);
else if (r == 1)
{
- INF("property value changed %s (%c)\n", name, t);
+ INF("E-Dbus connman: property value changed %s (%c)", name, t);
changed = 1;
}
if (changed)
if (!eina_hash_add(elements, element->path, element))
{
- ERR("could not add element %s to hash, delete it.\n", path);
+ ERR("E-Dbus connman: could not add element %s to hash, delete it.", path);
e_connman_element_free(element);
return NULL;
}
if (!e_connman_element_is_network(network))
{
- WRN("path '%s' is not a network!\n", path);
+ WRN("E-Dbus connman: path '%s' is not a network!", path);
return NULL;
}
extern const char *e_connman_prop_wifi_passphrase;
extern const char *e_connman_prop_wifi_security;
extern const char *e_connman_prop_wifi_ssid;
+extern int _e_dbus_connman_log_dom;
+#undef DBG
+#undef INF
+#undef WRN
+#undef ERR
-#define DBG(...) EINA_ERROR_PDBG(__VA_ARGS__)
-#define INF(...) EINA_ERROR_PINFO(__VA_ARGS__)
-#define WRN(...) EINA_ERROR_PWARN(__VA_ARGS__)
-#define ERR(...) EINA_ERROR_PERR(__VA_ARGS__)
+#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__)
static inline bool
__dbus_callback_check_and_init(const char *file, int line, const char *function, DBusMessage *msg, DBusMessageIter *itr, DBusError *err)
if (!msg)
{
if (err)
- eina_error_print(EINA_ERROR_LEVEL_ERR, file, function, line,
- "an error was reported by server: "
- "name=\"%s\", message=\"%s\"\n",
- err->name, err->message);
+ ERROR(file, function, line,
+ "an error was reported by server: "
+ "name=\"%s\", message=\"%s\"",
+ err->name, err->message);
else
- eina_error_print(EINA_ERROR_LEVEL_ERR, file, function, line,
- "callback without message arguments!\n");
+ ERROR(file, function, line,
+ "callback without message arguments!");
return 0;
}
if (!dbus_message_iter_init(msg, itr))
{
- eina_error_print(EINA_ERROR_LEVEL_ERR, file, function, line,
- "could not init iterator.\n");
+ ERROR(file, function, line,
+ "could not init iterator.");
return 0;
}
if (type == expected)
return 1;
- eina_error_print(EINA_ERROR_LEVEL_ERR, file, function, line,
- "expected type %s (%c) but got %c instead!\n",
- expected_name, expected, type);
+ ERROR(file, function, line,
+ "expected type %s (%c) but got %c instead!",
+ expected_name, expected, type);
return 0;
}
if (!e_connman_element_is_profile(profile))
{
- WRN("path '%s' is not a profile!\n", path);
+ WRN("E-Dbus connman: path '%s' is not a profile!", path);
return NULL;
}
#ifdef __cplusplus
extern "C" {
#endif
-
+ EAPI extern int E_DBUS_DOMAIN_GLOBAL;
EAPI extern int E_DBUS_EVENT_SIGNAL;
typedef struct E_DBus_Connection E_DBus_Connection;
* listen for NameOwnerChanged signals for names we have SignalHandler's for
* remap SH to listen for signals from new owner
*/
-
+int _E_DBUS_LOG_DOM_GLOBAL = -1;
static int connection_slot = -1;
static int init = 0;
E_DBus_Handler_Data *hd;
unsigned int condition = 0;
- DEBUG(5, "fd handler (%ld)!\n", (long int)fd_handler);
+ E_DBUS_LOG_DBG("fd handler (%ld)!", (long int)fd_handler);
hd = data;
if (!hd->enabled) {
- DEBUG(5, "handler disabled\n");
+ E_DBUS_LOG_DBG("handler disabled");
if (hd->fd_handler) ecore_main_fd_handler_del(hd->fd_handler);
hd->fd_handler = NULL;
return 0;
if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE)) condition |= DBUS_WATCH_WRITABLE;
if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_ERROR)) condition |= DBUS_WATCH_ERROR;
- if (condition & DBUS_WATCH_ERROR) DEBUG(5, "DBUS watch error\n");
+ if (condition & DBUS_WATCH_ERROR) E_DBUS_LOG_DBG("DBUS watch error");
dbus_watch_handle(hd->watch, condition);
hd = NULL;
Ecore_Fd_Handler_Flags eflags;
if (hd->fd_handler) return;
- DEBUG(5, "fd handler add (%d)\n", hd->fd);
+ E_DBUS_LOG_DBG("fd handler add (%d)", hd->fd);
dflags = dbus_watch_get_flags(hd->watch);
eflags = ECORE_FD_ERROR;
{
E_DBus_Handler_Data *hd = data;
- DEBUG(5, "e_dbus_handler_data_free\n");
+ E_DBUS_LOG_DBG("e_dbus_handler_data_free");
if (hd->fd_handler)
{
hd->cd->fd_handlers = eina_list_remove(hd->cd->fd_handlers, hd->cd->fd_handlers);
#else
hd->fd = dbus_watch_get_fd(hd->watch);
#endif
- DEBUG(5, "watch add (enabled: %d)\n", hd->enabled);
+ E_DBUS_LOG_DBG("watch add (enabled: %d)", hd->enabled);
if (hd->enabled) e_dbus_fd_handler_add(hd);
}
conn_name = dbus_bus_get_unique_name(conn);
if (conn_name)
{
- DEBUG(1, "Connected! Name: %s\n", conn_name);
+ E_DBUS_LOG_DBG("Connected! Name: %s", conn_name);
cd->conn_name = strdup(conn_name);
}
else
- DEBUG(1, "Not connected\n");
+ E_DBUS_LOG_DBG("Not connected");
cd->shared_type = -1;
cd->fd_handlers = NULL;
E_DBus_Connection *cd = data;
Ecore_Fd_Handler *fd_handler;
Ecore_Timer *timer;
- DEBUG(5, "e_dbus_connection free!\n");
+ E_DBUS_LOG_DBG("e_dbus_connection free!");
EINA_LIST_FREE(cd->fd_handlers, fd_handler)
ecore_main_fd_handler_del(fd_handler);
cb_main_wakeup(void *data)
{
E_DBus_Connection *cd;
- DEBUG(5, "wakeup main!\n");
+ E_DBUS_LOG_DBG("wakeup main!");
cd = data;
if (!cd->idler) cd->idler = ecore_idler_add(e_dbus_idler, cd);
- else DEBUG(1, "already idling\n");
+ else E_DBUS_LOG_DBG("already idling");
}
static void
{
E_DBus_Connection *cd;
- DEBUG(5, "dispatch status: %d!\n", new_status);
+ E_DBUS_LOG_DBG("dispatch status: %d!", new_status);
cd = data;
if (new_status == DBUS_DISPATCH_DATA_REMAINS && !cd->idler) cd->idler = ecore_idler_add(e_dbus_idler, cd);
if (dbus_timeout_get_enabled(td->timeout))
{
- DEBUG(5, "timeout_handler (not enabled, ending)\n");
+ E_DBUS_LOG_DBG("timeout_handler (not enabled, ending)");
td->handler = NULL;
return 0;
}
- DEBUG(5, "timeout handler!\n");
+ E_DBUS_LOG_DBG("timeout handler!");
dbus_timeout_handle(td->timeout);
return 1;
}
e_dbus_timeout_data_free(void *timeout_data)
{
E_DBus_Timeout_Data *td = timeout_data;
- DEBUG(5, "e_dbus_timeout_data_free\n");
+ E_DBUS_LOG_DBG("e_dbus_timeout_data_free");
if (td->handler) ecore_timer_del(td->handler);
free(td);
}
E_DBus_Timeout_Data *td;
cd = data;
- DEBUG(5, "timeout add!\n");
+ E_DBUS_LOG_DBG("timeout add!");
td = calloc(1, sizeof(E_DBus_Timeout_Data));
td->cd = cd;
dbus_timeout_set_data(timeout, (void *)td, e_dbus_timeout_data_free);
cb_timeout_del(DBusTimeout *timeout, void *data)
{
E_DBus_Timeout_Data *td;
- DEBUG(5, "timeout del!\n");
+ E_DBUS_LOG_DBG("timeout del!");
td = (E_DBus_Timeout_Data *)dbus_timeout_get_data(timeout);
cb_timeout_toggle(DBusTimeout *timeout, void *data)
{
E_DBus_Timeout_Data *td;
- DEBUG(5, "timeout toggle!\n");
+ E_DBUS_LOG_DBG("timeout toggle!");
td = (E_DBus_Timeout_Data *)dbus_timeout_get_data(timeout);
E_DBus_Connection *cd;
cd = data;
- DEBUG(5, "cb_watch_add\n");
+ E_DBUS_LOG_DBG("cb_watch_add");
e_dbus_connection_data_watch_add(cd, watch);
return true;
{
E_DBus_Handler_Data *hd;
- DEBUG(5, "cb_watch_del\n");
+ E_DBUS_LOG_DBG("cb_watch_del");
hd = (E_DBus_Handler_Data *)dbus_watch_get_data(watch);
if (hd->fd_handler)
{
E_DBus_Handler_Data *hd;
- DEBUG(5, "cb_watch_toggle\n");
+ E_DBUS_LOG_DBG("cb_watch_toggle");
hd = dbus_watch_get_data(watch);
if (!hd) return;
e_dbus_filter(DBusConnection *conn, DBusMessage *message, void *user_data)
{
E_DBus_Connection *cd = user_data;
- DEBUG(3, "-----------------\nMessage!\n\n");
+ E_DBUS_LOG_DBG("-----------------");
+ E_DBUS_LOG_DBG("Message!");
- DEBUG(3, "type: %s\n", dbus_message_type_to_string(dbus_message_get_type(message)));
- DEBUG(3, "path: %s\n", dbus_message_get_path(message));
- DEBUG(3, "interface: %s\n", dbus_message_get_interface(message));
- DEBUG(3, "member: %s\n", dbus_message_get_member(message));
- DEBUG(3, "sender: %s\n", dbus_message_get_sender(message));
+ E_DBUS_LOG_DBG("type: %s", dbus_message_type_to_string(dbus_message_get_type(message)));
+ E_DBUS_LOG_DBG("path: %s", dbus_message_get_path(message));
+ E_DBUS_LOG_DBG("interface: %s", dbus_message_get_interface(message));
+ E_DBUS_LOG_DBG("member: %s", dbus_message_get_member(message));
+ E_DBUS_LOG_DBG("sender: %s", dbus_message_get_sender(message));
switch (dbus_message_get_type(message))
{
case DBUS_MESSAGE_TYPE_METHOD_CALL:
- DEBUG(3, "signature: %s\n", dbus_message_get_signature(message));
+ E_DBUS_LOG_DBG("signature: %s", dbus_message_get_signature(message));
break;
case DBUS_MESSAGE_TYPE_METHOD_RETURN:
- DEBUG(3, "reply serial %d\n", dbus_message_get_reply_serial(message));
+ E_DBUS_LOG_DBG("reply serial %d", dbus_message_get_reply_serial(message));
break;
case DBUS_MESSAGE_TYPE_ERROR:
- DEBUG(3, "error: %s\n", dbus_message_get_error_name(message));
+ E_DBUS_LOG_DBG("error: %s", dbus_message_get_error_name(message));
break;
case DBUS_MESSAGE_TYPE_SIGNAL:
dbus_message_ref(message);
default:
break;
}
- DEBUG(3, "-----------------\n\n");
+ E_DBUS_LOG_DBG("-----------------");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
if (DBUS_DISPATCH_COMPLETE == dbus_connection_get_dispatch_status(cd->conn))
{
- DEBUG(5, "done dispatching!\n");
+ E_DBUS_LOG_DBG("done dispatching!");
cd->idler = NULL;
return 0;
}
e_dbus_idler_active++;
dbus_connection_ref(cd->conn);
- DEBUG(5, "dispatch!\n");
+ E_DBUS_LOG_DBG("dispatch!");
dbus_connection_dispatch(cd->conn);
dbus_connection_unref(cd->conn);
e_dbus_idler_active--;
conn = dbus_bus_get_private(type, &err);
if (dbus_error_is_set(&err))
{
- fprintf(stderr, "Error connecting to bus: %s\n", err.message);
+ E_DBUS_LOG_ERR("Error connecting to bus: %s", err.message);
dbus_error_free(&err);
return NULL;
}
econn = e_dbus_connection_setup(conn);
if (!econn)
{
- fprintf(stderr, "Error setting up dbus connection.\n");
+ E_DBUS_LOG_ERR("Error setting up dbus connection.");
dbus_connection_close(conn);
dbus_connection_unref(conn);
return NULL;
EAPI void
e_dbus_connection_close(E_DBus_Connection *conn)
{
- DEBUG(5, "e_dbus_connection_close\n");
+ E_DBUS_LOG_DBG("e_dbus_connection_close");
if (e_dbus_idler_active)
{
e_dbus_init(void)
{
if (++init != 1) return init;
+
+ /**
+ * eina initialization
+ */
+
+ if(!eina_init())
+ {
+ fprintf(stderr,"E-dbus: Enable to initialize the eina module");
+ return -1;
+ }
+
+ _E_DBUS_LOG_DOM_GLOBAL = eina_log_domain_register("e_dbus",E_DBUS_COLOR_DEFAULT);
+
+ if(_E_DBUS_LOG_DOM_GLOBAL < 0)
+ {
+ EINA_LOG_ERR("E-dbus: Enable to create a log domain\n");
+ eina_shutdown();
+ return -1;
+ }
- eina_init();
E_DBUS_EVENT_SIGNAL = ecore_event_type_new();
e_dbus_object_init();
return init;
{
if (--init) return init;
e_dbus_object_shutdown();
+ eina_log_domain_unregister(_E_DBUS_LOG_DOM_GLOBAL);
eina_shutdown();
return init;
}
(destination, path, "org.freedesktop.DBus.Peer", method_name);
if (!msg)
{
- fprintf(stderr,
- "ERROR: failed to create message for method call: %s() at "
- "\"%s\" at \"%s\"\n",
- method_name, destination, path);
+ E_DBUS_LOG_ERR("E-dbus Error: failed to create message for method call: %s() at "
+ "\"%s\" at \"%s\"",
+ method_name, destination, path);
return NULL;
}
dbus_message_unref(msg);
if (!ret)
- fprintf(stderr, "ERROR: could not %s() \"%s\" at \"%s\".\n",
- method_name, destination, path);
-
+ E_DBUS_LOG_ERR("E-dbus Error: could not %s() \"%s\" at \"%s\".",
+ method_name, destination, path);
+
return ret;
}
if (!conn)
{
- fprintf(stderr, "ERROR: no connection for call of %s\n", method_name);
+ E_DBUS_LOG_ERR("E-dbus Error: no connection for call of %s", method_name);
return NULL;
}
(destination, path, "org.freedesktop.DBus.Properties", method_name);
if (!msg)
{
- fprintf(stderr,
- "ERROR: failed to create message for method call: %s() at "
- "\"%s\" at \"%s\"\n",
- method_name, destination, path);
- return NULL;
+ E_DBUS_LOG_ERR("E-dbus Error: failed to create message for method call: %s() at "
+ "\"%s\" at \"%s\"",
+ method_name, destination, path);
+ return NULL;
}
if (property)
dbus_message_unref(msg);
if (!ret)
- fprintf(stderr, "ERROR: failed to call GetAll() at \"%s\" at \"%s\"\n",
- destination, path);
+ E_DBUS_LOG_ERR("ERROR: failed to call GetAll() at \"%s\" at \"%s\"",
+ destination, path);
return ret;
}
dbus_message_unref(msg);
if (!ret)
- fprintf(stderr, "ERROR: failed to call Get() at \"%s\" at \"%s\"\n",
- destination, path);
+ E_DBUS_LOG_ERR("E-dbus Error: failed to call Get() at \"%s\" at \"%s\"",
+ destination, path);
return ret;
}
dbus_message_unref(msg);
if (!ret)
- fprintf(stderr, "ERROR: failed to call Set() at \"%s\" at \"%s\"\n",
- destination, path);
+ E_DBUS_LOG_ERR("E-dbus Error: failed to call Set() at \"%s\" at \"%s\"",
+ destination, path);
return ret;
}
if (!dbus_pending_call_get_completed(pending))
{
- printf("NOT COMPLETED\n");
+ E_DBUS_LOG_INFO("E-dbus: NOT COMPLETED");
free(data);
dbus_message_unref(msg);
dbus_pending_call_unref(pending);
("org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus",
method_name);
if (!msg)
- fprintf(stderr, "ERROR: failed to create message for method call: %s\n",
- method_name);
+ E_DBUS_LOG_ERR("E-dbus Error: failed to create message for method call: %s",
+ method_name);
return msg;
}
if (!conn)
{
- fprintf(stderr, "ERROR: no connection for call of %s\n", method_name);
- return NULL;
+ E_DBUS_LOG_ERR("E.dbus Error: no connection for call of %s", method_name);
+ return NULL;
}
-
+
msg = _dbus_message_method_call(method_name);
if (!msg)
return NULL;
dbus_message_unref(msg);
if (!ret)
- fprintf(stderr, "ERROR: failed to call %s()\n", method_name);
+ E_DBUS_LOG_ERR("E-dbus Error: failed to call %s()", method_name);
return ret;
}
if (!conn)
{
- fprintf(stderr, "ERROR: no connection for call of %s\n", method_name);
+ E_DBUS_LOG_ERR("E-dbus Error: no connection for call of %s", method_name);
return NULL;
}
dbus_message_unref(msg);
if (!ret)
- fprintf(stderr, "ERROR: failed to call %s(\"%s\")\n", method_name, str);
-
+ E_DBUS_LOG_ERR("E-dbus Error: failed to call %s(\"%s\")", method_name, str);
+
return ret;
}
if (!conn)
{
- fputs("ERROR: no connection for call of RequestName\n", stderr);
+ E_DBUS_LOG_ERR("E-dbus Error: no connection for call of RequestName");
return NULL;
}
if (!conn)
{
- fprintf(stderr, "ERROR: no connection for call of %s\n", method_name);
+ E_DBUS_LOG_ERR("ERROR: no connection for call of %s", method_name);
return NULL;
}
dbus_message_unref(msg);
if (!ret)
- fprintf(stderr, "ERROR: failed to call %s(\"%s\")\n", method_name, name);
+ E_DBUS_LOG_ERR("E-dbus Error: failed to call %s(\"%s\")", method_name, name);
return ret;
}
if (!obj) return;
- DEBUG(5, "e_dbus_object_free (%s)\n", obj->path);
+ E_DBUS_LOG_DBG("e_dbus_object_free (%s)", obj->path);
dbus_connection_unregister_object_path(obj->conn->conn, obj->path);
e_dbus_connection_close(obj->conn);
e_dbus_interface_ref(iface);
obj->interfaces = eina_list_append(obj->interfaces, iface);
obj->introspection_dirty = 1;
- DEBUG(4, "e_dbus_object_interface_attach (%s, %s) ", obj->path, iface->name);
+ E_DBUS_LOG_DBG("e_dbus_object_interface_attach (%s, %s) ", obj->path, iface->name);
}
EAPI void
{
E_DBus_Interface *found;
- DEBUG(4, "e_dbus_object_interface_detach (%s, %s) ", obj->path, iface->name);
+ E_DBUS_LOG_DBG("e_dbus_object_interface_detach (%s, %s) ", obj->path, iface->name);
found = eina_list_data_find(obj->interfaces, iface);
if (found == NULL) return;
e_dbus_interface_ref(E_DBus_Interface *iface)
{
iface->refcount++;
- DEBUG(4, "e_dbus_interface_ref (%s) = %d\n", iface->name, iface->refcount);
+ E_DBUS_LOG_DBG("e_dbus_interface_ref (%s) = %d", iface->name, iface->refcount);
}
EAPI void
e_dbus_interface_unref(E_DBus_Interface *iface)
{
- DEBUG(4, "e_dbus_interface_unref (%s) = %d\n", iface->name, iface->refcount - 1);
+ E_DBUS_LOG_DBG("e_dbus_interface_unref (%s) = %d", iface->name, iface->refcount - 1);
if (--(iface->refcount) == 0)
e_dbus_interface_free(iface);
}
E_DBus_Method *m;
m = e_dbus_method_new(member, signature, reply_signature, func);
- DEBUG(4, "Add method %s: %p\n", member, m);
+ E_DBUS_LOG_DBG("E-dbus: Add method %s: %p", member, m);
if (!m) return 0;
iface->methods = eina_list_append(iface->methods, m);
E_DBus_Signal *s;
s = e_dbus_signal_new(name, signature);
- DEBUG(4, "Add signal %s: %p\n", name, s);
+ E_DBUS_LOG_DBG("E-dbus: Add signal %s: %p", name, s);
if (!s) return 0;
iface->signals = eina_list_append(iface->signals, s);
ecore_strbuf_append(buf, "\">\n");
level++;
- DEBUG(4, "introspect iface: %s\n", iface->name);
+ E_DBUS_LOG_DBG("introspect iface: %s", iface->name);
EINA_LIST_FOREACH(iface->methods, l, method)
_introspect_method_append(buf, method, level);
EINA_LIST_FOREACH(iface->signals, l, signal)
char *type;
_introspect_indent_append(buf, level);
- DEBUG(4, "introspect method: %s\n", method->member);
+ E_DBUS_LOG_DBG("introspect method: %s\n", method->member);
ecore_strbuf_append(buf, "<method name=\"");
ecore_strbuf_append(buf, method->member);
ecore_strbuf_append(buf, "\">\n");
char *type;
_introspect_indent_append(buf, level);
- DEBUG(4, "introspect signal: %s\n", signal->name);
+ E_DBUS_LOG_DBG("introspect signal: %s", signal->name);
ecore_strbuf_append(buf, "<signal name=\"");
ecore_strbuf_append(buf, signal->name);
ecore_strbuf_append(buf, "\">\n");
#include "dbus/dbus.h"
#include "Ecore_Data.h"
+#include "eina_log.h"
+
+#define E_DBUS_COLOR_DEFAULT "\033[36m"
+extern int _E_DBUS_LOG_DOM_GLOBAL ;
+#define E_DBUS_LOG_DBG(...) EINA_LOG_DOM_DBG(_E_DBUS_LOG_DOM_GLOBAL , __VA_ARGS__)
+#define E_DBUS_LOG_INFO(...) EINA_LOG_DOM_INFO(_E_DBUS_LOG_DOM_GLOBAL , __VA_ARGS__)
+#define E_DBUS_LOG_WARN(...) EINA_LOG_DOM_WARN(_E_DBUS_LOG_DOM_GLOBAL , __VA_ARGS__)
+#define E_DBUS_LOG_ERR(...) EINA_LOG_DOM_ERR(_E_DBUS_LOG_DOM_GLOBAL , __VA_ARGS__)
-#define DEBUG_LVL 0
-#define DEBUG(lvl, ...) if (lvl <= DEBUG_LVL) printf(__VA_ARGS__)
struct E_DBus_Connection
{
error:
if (err)
- DEBUG(1, "ERROR: %s %s\n", err->name, err->message);
+ E_DBUS_LOG_ERR("Error: %s %s", err->name, err->message);
/* FIXME: this is bad. the handler gets silently freed and the caller has no
* idea that it was freed - or if, or when.
conn->signal_handlers = eina_list_remove(conn->signal_handlers, sh);
_match_append(char *buf, int size, int *used, const char *keyword, int keyword_size, const char *value, int value_size)
{
if(value == NULL)
- return 1;
+ return 1;
if (*used + keyword_size + value_size + sizeof(",=''") >= size)
{
- DEBUG(1, "ERROR: cannot add match %s='%s': too long!\n", keyword, value);
+ E_DBUS_LOG_ERR("cannot add match %s='%s': too long!", keyword, value);
return 0;
}
sh = malloc(sizeof(*sh) + len);
if (!sh)
{
- DEBUG(1, "ERROR: could not allocate signal handler.\n");
+ E_DBUS_LOG_ERR("could not allocate signal handler.");
return NULL;
}
#include <E_Hal.h>
+#include <e_dbus_private.h>
#define e_hal_device_call_new(udi, member) dbus_message_new_method_call(E_HAL_SENDER, udi, E_HAL_DEVICE_INTERFACE, member)
#define e_hal_device_volume_call_new(udi, member) dbus_message_new_method_call(E_HAL_SENDER, udi, E_HAL_DEVICE_VOLUME_INTERFACE, member)
}
break;
default:
- printf("Error: unexpected property type (%s): %c\n", name, dbus_message_iter_get_arg_type(&v_iter));
+ E_DBUS_LOG_WARN("Ehal Error: unexpected property type (%s): %c", name, dbus_message_iter_get_arg_type(&v_iter));
break;
}
eina_hash_add(ret->properties, name, prop);
#include "E_Nm.h"
#include "e_nm_private.h"
-
+#include "e_dbus_private.h"
#include <string.h>
static const Property properties[] = {
dbus_message_get_args(msg, &err, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- printf("Error: %s - %s\n", err.name, err.message);
+ E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
return;
}
dbus_message_get_args(msg, &err, DBUS_TYPE_OBJECT_PATH, &device, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- printf("Error: %s - %s\n", err.name, err.message);
+ E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
return;
}
dbus_message_get_args(msg, &err, DBUS_TYPE_OBJECT_PATH, &device, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- printf("Error: %s - %s\n", err.name, err.message);
+ E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
return;
}
const char *conn;
if (!nm) return;
- printf("E_NM:\n");
- printf("wireless_enabled : %d\n", nm->wireless_enabled);
- printf("wireless_hardware_enabled: %d\n", nm->wireless_hardware_enabled);
- printf("active_connections :\n");
+ INFO("E_NM:");
+ INFO("wireless_enabled : %d", nm->wireless_enabled);
+ INFO("wireless_hardware_enabled: %d", nm->wireless_hardware_enabled);
+ INFO("active_connections :");
if (nm->active_connections)
{
ecore_list_first_goto(nm->active_connections);
while ((conn = ecore_list_next(nm->active_connections)))
- printf(" - %s\n", conn);
+ INFO(" - %s", conn);
}
- printf("state : ");
+ INFO("state : ");
switch (nm->state)
{
case E_NM_STATE_UNKNOWN:
- printf("E_NM_STATE_UNKNOWN\n");
+ INFO("E_NM_STATE_UNKNOWN");
break;
case E_NM_STATE_ASLEEP:
- printf("E_NM_STATE_ASLEEP\n");
+ INFO("E_NM_STATE_ASLEEP");
break;
case E_NM_STATE_CONNECTING:
- printf("E_NM_STATE_CONNECTING\n");
+ INFO("E_NM_STATE_CONNECTING");
break;
case E_NM_STATE_CONNECTED:
- printf("E_NM_STATE_CONNECTED\n");
+ INFO("E_NM_STATE_CONNECTED");
break;
case E_NM_STATE_DISCONNECTED:
- printf("E_NM_STATE_DISCONNECTED\n");
+ INFO("E_NM_STATE_DISCONNECTED");
break;
}
- printf("\n");
+ INFO("");
}
EAPI void
#include "E_Nm.h"
#include "e_nm_private.h"
-
+#include "e_dbus_private.h"
#include <string.h>
static const Property access_point_properties[] = {
EAPI void
e_nm_access_point_dump(E_NM_Access_Point *ap)
{
+ char buffer[1024];
unsigned char *c;
if (!ap) return;
- printf("E_NM_Access_Point:\n");
- printf("flags :");
+ E_DBUS_LOG_INFO("E_NM_Access_Point:");
+ E_DBUS_LOG_INFO("flags :");
if (ap->flags & E_NM_802_11_AP_FLAGS_PRIVACY)
- printf(" E_NM_802_11_AP_FLAGS_PRIVACY");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_FLAGS_PRIVACY");
if (ap->flags == E_NM_802_11_AP_FLAGS_NONE)
- printf(" E_NM_802_11_AP_FLAGS_NONE");
- printf("\n");
- printf("wpa_flags :");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_FLAGS_NONE");
+ E_DBUS_LOG_INFO("");
+ E_DBUS_LOG_INFO("wpa_flags :");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_PAIR_WEP40)
- printf(" E_NM_802_11_AP_SEC_PAIR_WEP40");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_WEP40");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_PAIR_WEP104)
- printf(" E_NM_802_11_AP_SEC_PAIR_WEP104");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_WEP104");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_PAIR_TKIP)
- printf(" E_NM_802_11_AP_SEC_PAIR_TKIP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_TKIP");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_PAIR_CCMP)
- printf(" E_NM_802_11_AP_SEC_PAIR_CCMP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_CCMP");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_GROUP_WEP40)
- printf(" E_NM_802_11_AP_SEC_GROUP_WEP40");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_WEP40");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_GROUP_WEP104)
- printf(" E_NM_802_11_AP_SEC_GROUP_WEP104");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_WEP104");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_GROUP_TKIP)
- printf(" E_NM_802_11_AP_SEC_GROUP_TKIP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_TKIP");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_GROUP_CCMP)
- printf(" E_NM_802_11_AP_SEC_GROUP_CCMP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_CCMP");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_KEY_MGMT_PSK)
- printf(" E_NM_802_11_AP_SEC_KEY_MGMT_PSK");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_PSK");
if (ap->wpa_flags & E_NM_802_11_AP_SEC_KEY_MGMT_802_1X)
- printf(" E_NM_802_11_AP_SEC_KEY_MGMT_802_1X");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_802_1X");
if (ap->wpa_flags == E_NM_802_11_AP_SEC_NONE)
- printf(" E_NM_802_11_AP_SEC_NONE");
- printf("\n");
- printf("rsn_flags :");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_NONE");
+ E_DBUS_LOG_INFO("");
+ E_DBUS_LOG_INFO("rsn_flags :");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_PAIR_WEP40)
- printf(" E_NM_802_11_AP_SEC_PAIR_WEP40");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_WEP40");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_PAIR_WEP104)
- printf(" E_NM_802_11_AP_SEC_PAIR_WEP104");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_WEP104");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_PAIR_TKIP)
- printf(" E_NM_802_11_AP_SEC_PAIR_TKIP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_TKIP");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_PAIR_CCMP)
- printf(" E_NM_802_11_AP_SEC_PAIR_CCMP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_PAIR_CCMP");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_GROUP_WEP40)
- printf(" E_NM_802_11_AP_SEC_GROUP_WEP40");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_WEP40");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_GROUP_WEP104)
- printf(" E_NM_802_11_AP_SEC_GROUP_WEP104");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_WEP104");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_GROUP_TKIP)
- printf(" E_NM_802_11_AP_SEC_GROUP_TKIP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_TKIP");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_GROUP_CCMP)
- printf(" E_NM_802_11_AP_SEC_GROUP_CCMP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_GROUP_CCMP");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_KEY_MGMT_PSK)
- printf(" E_NM_802_11_AP_SEC_KEY_MGMT_PSK");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_PSK");
if (ap->rsn_flags & E_NM_802_11_AP_SEC_KEY_MGMT_802_1X)
- printf(" E_NM_802_11_AP_SEC_KEY_MGMT_802_1X");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_KEY_MGMT_802_1X");
if (ap->rsn_flags == E_NM_802_11_AP_SEC_NONE)
- printf(" E_NM_802_11_AP_SEC_NONE");
- printf("\n");
- printf("ssid : ");
+ E_DBUS_LOG_INFO(" E_NM_802_11_AP_SEC_NONE");
+ E_DBUS_LOG_INFO("");
+ strcpy(buffer, "ssid : ");
if (ap->ssid)
{
+
ecore_list_first_goto(ap->ssid);
while ((c = ecore_list_next(ap->ssid)))
- printf("%c", *c);
- printf("\n");
+ snprintf("%s%c", buffer, *c);
}
- printf("frequency : %u\n", ap->frequency);
- printf("hw_address : %s\n", ap->hw_address);
- printf("mode : ");
+ E_DBUS_LOG_INFO("%s", buffer);
+ E_DBUS_LOG_INFO("frequency : %u", ap->frequency);
+ E_DBUS_LOG_INFO("hw_address : %s", ap->hw_address);
+ E_DBUS_LOG_INFO("mode : ");
switch (ap->mode)
{
case E_NM_802_11_MODE_UNKNOWN:
- printf("E_NM_802_11_MODE_UNKNOWN\n");
+ E_DBUS_LOG_INFO("E_NM_802_11_MODE_UNKNOWN");
break;
case E_NM_802_11_MODE_ADHOC:
- printf("E_NM_802_11_MODE_ADHOC\n");
+ E_DBUS_LOG_INFO("E_NM_802_11_MODE_ADHOC");
break;
case E_NM_802_11_MODE_INFRA:
- printf("E_NM_802_11_MODE_INFRA\n");
+ E_DBUS_LOG_INFO("E_NM_802_11_MODE_INFRA");
break;
}
- printf("max_bitrate: %u\n", ap->max_bitrate);
- printf("strength : %u\n", ap->strength);
- printf("\n");
+ E_DBUS_LOG_INFO("max_bitrate: %u", ap->max_bitrate);
+ E_DBUS_LOG_INFO("strength : %u", ap->strength);
+ E_DBUS_LOG_INFO("");
}
EAPI void
#include "E_Nm.h"
#include "e_nm_private.h"
-
+#include "e_dbus_private.h"
#include <string.h>
static const Property active_connection_properties[] = {
const char *device;
if (!conn) return;
- printf("E_NM_Active_Connection:\n");
- printf("service_name : %s\n", conn->service_name);
- printf("connection : %s\n", conn->connection);
- printf("specific_object: %s\n", conn->specific_object);
- printf("devices :\n");
+ E_DBUS_LOG_INFO("E_NM_Active_Connection:");
+ E_DBUS_LOG_INFO("service_name : %s", conn->service_name);
+ E_DBUS_LOG_INFO("connection : %s", conn->connection);
+ E_DBUS_LOG_INFO("specific_object: %s", conn->specific_object);
+ E_DBUS_LOG_INFO("devices :");
ecore_list_first_goto(conn->devices);
while ((device = ecore_list_next(conn->devices)))
- printf(" - %s\n", device);
- printf("state : ");
+ E_DBUS_LOG_INFO(" - %s", device);
+ E_DBUS_LOG_INFO("state : ");
switch (conn->state)
{
case E_NM_ACTIVE_CONNECTION_STATE_UNKNOWN:
- printf("E_NM_ACTIVE_CONNECTION_STATE_UNKNOWN\n");
+ E_DBUS_LOG_INFO("E_NM_ACTIVE_CONNECTION_STATE_UNKNOWN");
break;
case E_NM_ACTIVE_CONNECTION_STATE_ACTIVATING:
- printf("E_NM_ACTIVE_CONNECTION_STATE_ACTIVATING\n");
+ E_DBUS_LOG_INFO("E_NM_ACTIVE_CONNECTION_STATE_ACTIVATING");
break;
case E_NM_ACTIVE_CONNECTION_STATE_ACTIVATED:
- printf("E_NM_ACTIVE_CONNECTION_STATE_ACTIVATED\n");
+ E_DBUS_LOG_INFO("E_NM_ACTIVE_CONNECTION_STATE_ACTIVATED");
break;
}
- printf("default : %d\n", conn->def);
- printf("\n");
+ E_DBUS_LOG_INFO("default : %d", conn->def);
+ E_DBUS_LOG_INFO("");
}
#include "E_Nm.h"
#include "e_nm_private.h"
-
+#include "e_dbus_private.h"
#include <string.h>
static void property_device_type(Property_Data *data, DBusMessageIter *iter);
DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- printf("Error: %s - %s\n", err.name, err.message);
+ E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
return;
}
DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- printf("Error: %s - %s\n", err.name, err.message);
+ E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
return;
}
DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- printf("Error: %s - %s\n", err.name, err.message);
+ E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
return;
}
dev = d->object;
if (dbus_error_is_set(err))
{
- printf("Error: %s - %s\n", err->name, err->message);
+ E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
e_nm_device_dump(E_NM_Device *dev)
{
if (!dev) return;
- printf("E_NM_Device:\n");
- printf("udi : %s\n", dev->udi);
- printf("interface : %s\n", dev->interface);
- printf("driver : %s\n", dev->driver);
- printf("capabilities :");
+ E_DBUS_LOG_INFO("E_NM_Device:");
+ E_DBUS_LOG_INFO("udi : %s", dev->udi);
+ E_DBUS_LOG_INFO("interface : %s", dev->interface);
+ E_DBUS_LOG_INFO("driver : %s", dev->driver);
+ E_DBUS_LOG_INFO("capabilities :");
if (dev->capabilities & E_NM_DEVICE_CAP_NM_SUPPORTED)
- printf(" E_NM_DEVICE_CAP_NM_SUPPORTED");
+ E_DBUS_LOG_INFO(" E_NM_DEVICE_CAP_NM_SUPPORTED");
if (dev->capabilities & E_NM_DEVICE_CAP_CARRIER_DETECT)
- printf(" E_NM_DEVICE_CAP_CARRIER_DETECT");
+ E_DBUS_LOG_INFO(" E_NM_DEVICE_CAP_CARRIER_DETECT");
if (dev->capabilities == E_NM_DEVICE_CAP_NONE)
- printf(" E_NM_DEVICE_CAP_NONE");
- printf("\n");
- printf("ip4_address : %s\n", ip4_address2str(dev->ip4_address));
- printf("state : ");
+ E_DBUS_LOG_INFO(" E_NM_DEVICE_CAP_NONE");
+ E_DBUS_LOG_INFO("");
+ E_DBUS_LOG_INFO("ip4_address : %s", ip4_address2str(dev->ip4_address));
+ E_DBUS_LOG_INFO("state : ");
switch (dev->state)
{
case E_NM_DEVICE_STATE_UNKNOWN:
- printf("E_NM_DEVICE_STATE_UNKNOWN\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_UNKNOWN");
break;
case E_NM_DEVICE_STATE_UNMANAGED:
- printf("E_NM_DEVICE_STATE_UNMANAGED\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_UNMANAGED");
break;
case E_NM_DEVICE_STATE_UNAVAILABLE:
- printf("E_NM_DEVICE_STATE_UNAVAILABLE\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_UNAVAILABLE");
break;
case E_NM_DEVICE_STATE_DISCONNECTED:
- printf("E_NM_DEVICE_STATE_DISCONNECTED\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_DISCONNECTED");
break;
case E_NM_DEVICE_STATE_PREPARE:
- printf("E_NM_DEVICE_STATE_PREPARE\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_PREPARE");
break;
case E_NM_DEVICE_STATE_CONFIG:
- printf("E_NM_DEVICE_STATE_CONFIG\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_CONFIG");
break;
case E_NM_DEVICE_STATE_NEED_AUTH:
- printf("E_NM_DEVICE_STATE_NEED_AUTH\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_NEED_AUTH");
break;
case E_NM_DEVICE_STATE_IP_CONFIG:
- printf("E_NM_DEVICE_STATE_IP_CONFIG\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_IP_CONFIG");
break;
case E_NM_DEVICE_STATE_ACTIVATED:
- printf("E_NM_DEVICE_STATE_ACTIVATED\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_ACTIVATED");
break;
case E_NM_DEVICE_STATE_FAILED:
- printf("E_NM_DEVICE_STATE_FAILED\n");
+ E_DBUS_LOG_INFO("E_NM_DEVICE_STATE_FAILED");
break;
}
- printf("ip4_config : %s\n", dev->ip4_config);
- printf("dhcp4_config : %s\n", dev->dhcp4_config);
- printf("managed : %d\n", dev->managed);
- printf("device_type : %u\n", dev->device_type);
+ E_DBUS_LOG_INFO("ip4_config : %s", dev->ip4_config);
+ E_DBUS_LOG_INFO("dhcp4_config : %s", dev->dhcp4_config);
+ E_DBUS_LOG_INFO("managed : %d", dev->managed);
+ E_DBUS_LOG_INFO("device_type : %u", dev->device_type);
switch (dev->device_type)
{
case E_NM_DEVICE_TYPE_WIRED:
- printf("hw_address : %s\n", dev->wired.hw_address);
- printf("speed : %u\n", dev->wired.speed);
- printf("carrier : %d\n", dev->wired.carrier);
+ E_DBUS_LOG_INFO("hw_address : %s", dev->wired.hw_address);
+ E_DBUS_LOG_INFO("speed : %u", dev->wired.speed);
+ E_DBUS_LOG_INFO("carrier : %d", dev->wired.carrier);
break;
case E_NM_DEVICE_TYPE_WIRELESS:
- printf("hw_address : %s\n", dev->wireless.hw_address);
- printf("mode : ");
+ E_DBUS_LOG_INFO("hw_address : %s", dev->wireless.hw_address);
+ E_DBUS_LOG_INFO("mode : ");
switch (dev->wireless.mode)
{
case E_NM_802_11_MODE_UNKNOWN:
- printf("E_NM_802_11_MODE_UNKNOWN\n");
+ E_DBUS_LOG_INFO("E_NM_802_11_MODE_UNKNOWN");
break;
case E_NM_802_11_MODE_ADHOC:
- printf("E_NM_802_11_MODE_ADHOC\n");
+ E_DBUS_LOG_INFO("E_NM_802_11_MODE_ADHOC");
break;
case E_NM_802_11_MODE_INFRA:
- printf("E_NM_802_11_MODE_INFRA\n");
+ E_DBUS_LOG_INFO("E_NM_802_11_MODE_INFRA");
break;
}
- printf("bitrate : %u\n", dev->wireless.bitrate);
- printf("active_access_point : %s\n", dev->wireless.active_access_point);
- printf("wireless_capabilities:");
+ E_DBUS_LOG_INFO("bitrate : %u", dev->wireless.bitrate);
+ E_DBUS_LOG_INFO("active_access_point : %s", dev->wireless.active_access_point);
+ E_DBUS_LOG_INFO("wireless_capabilities:");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_CIPHER_WEP40)
- printf(" E_NM_802_11_DEVICE_CAP_CIPHER_WEP40");
+ E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_CIPHER_WEP40");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_CIPHER_WEP104)
- printf(" E_NM_802_11_DEVICE_CAP_CIPHER_WEP104");
+ E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_CIPHER_WEP104");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_CIPHER_TKIP)
- printf(" E_NM_802_11_DEVICE_CAP_CIPHER_TKIP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_CIPHER_TKIP");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_CIPHER_CCMP)
- printf(" E_NM_802_11_DEVICE_CAP_CIPHER_CCMP");
+ E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_CIPHER_CCMP");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_WPA)
- printf(" E_NM_802_11_DEVICE_CAP_WPA");
+ E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_WPA");
if (dev->wireless.wireless_capabilities & E_NM_802_11_DEVICE_CAP_RSN)
- printf(" E_NM_802_11_DEVICE_CAP_RSN");
+ E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_RSN");
if (dev->wireless.wireless_capabilities == E_NM_802_11_DEVICE_CAP_NONE)
- printf(" E_NM_802_11_DEVICE_CAP_NONE");
- printf("\n");
+ E_DBUS_LOG_INFO(" E_NM_802_11_DEVICE_CAP_NONE");
+ E_DBUS_LOG_INFO("");
break;
}
- printf("\n");
+ E_DBUS_LOG_INFO("");
}
EAPI int
#include "E_Nm.h"
#include "e_nm_private.h"
-
+#include "e_dbus_private.h"
#include <string.h>
static const Property ip4_config_properties[] = {
Ecore_List *list;
if (!config) return;
- printf("E_NM_IP4_Config:\n");
+ E_DBUS_LOG_INFO("E_NM_IP4_Config:");
if (config->addresses)
{
- printf("addresses :\n");
+ char buffer[1024];
+
+ E_DBUS_LOG_INFO("addresses :");
ecore_list_first_goto(config->addresses);
while ((list = ecore_list_next(config->addresses)))
{
- printf(" -");
+ strcpy(buffer, " -");
ecore_list_first_goto(list);
while ((u = ecore_list_next(list)))
- printf(" %s", ip4_address2str(*u));
- printf("\n");
+ {
+ strcat(buffer, " ");
+ strcat(buffer, ip4_address2str(*u));
+ }
+ E_DBUS_LOG_INFO(buffer);
}
}
if (config->nameservers)
{
- printf("nameservers:\n");
+ E_DBUS_LOG_INFO("nameservers:");
ecore_list_first_goto(config->nameservers);
while ((u = ecore_list_next(config->nameservers)))
- printf(" - %s\n", ip4_address2str(*u));
+ E_DBUS_LOG_INFO(" - %s", ip4_address2str(*u));
}
if (config->domains)
{
- printf("domains :\n");
+ E_DBUS_LOG_INFO("domains :");
ecore_list_first_goto(config->domains);
while ((domain = ecore_list_next(config->domains)))
- printf(" - %s\n", domain);
+ E_DBUS_LOG_INFO(" - %s", domain);
}
if (config->routes)
{
- printf("routes :\n");
+ E_DBUS_LOG_INFO("routes :");
ecore_list_first_goto(config->routes);
while ((list = ecore_list_next(config->routes)))
{
- printf(" -");
+ char buffer[1024];
+
+ strcpy(buffer, " -");
ecore_list_first_goto(list);
while ((u = ecore_list_next(list)))
- printf(" %s", ip4_address2str(*u));
- printf("\n");
+ {
+ strcat(buffer, " ");
+ strcat(buffer, ip4_address2str(*u));
+ }
+ E_DBUS_LOG_INFO("%s", buffer);
}
}
- printf("\n");
+ E_DBUS_LOG_INFO("");
}
#include "E_Nm.h"
#include "e_nm_private.h"
-
+#include "e_dbus_private.h"
static void
check_done(Reply_Data *d, Ecore_List *list)
{
nm = d->object;
if (dbus_error_is_set(err))
{
- printf("Error: %s - %s\n", err->name, err->message);
+ E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
#include "E_Nm.h"
#include "e_nm_private.h"
#include "E_DBus.h"
+#include "e_dbus_private.h"
#include <string.h>
#include <Ecore_Data.h>
#define CHECK_SIGNATURE(msg, err, sig) \
if (dbus_error_is_set((err))) \
{ \
- printf("Error: %s - %s\n", (err)->name, (err)->message); \
+ E_DBUS_LOG_ERR("%s - %s", (err)->name, (err)->message); \
return NULL; \
} \
\
if (!strcmp(t->sig, sig))
return t->func;
}
- fprintf(stderr, "Missing property parser for sig: %s\n", sig);
+ E_DBUS_LOG_ERR("Missing property parser for sig: %s", sig);
return NULL;
}
if ((value) && (!sig))
{
- printf("Error: Can't have value and no sig\n");
+ E_DBUS_LOG_ERR("Can't have value and no sig");
return NULL;
}
dbus_message_iter_get_basic(iter, &str);
if ((value) && (!sig))
{
- printf("Error: Can't have value and no sig\n");
+ _EDBUS_LOG_ERR("Can't have value and no sig");
return NULL;
}
if (sig)
if ((value) && (!sig))
{
- printf("Error: Can't have value and no sig\n");
+ E_DBUS_LOG_ERR("Can't have value and no sig");
return NULL;
}
d = data;
if (dbus_error_is_set(err))
{
- printf("Error: %s - %s\n", err->name, err->message);
+ E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
goto error;
}
if (!dbus_message_has_signature(msg, "v")) goto error;
#include <string.h>
-#include <E_Nm.h>
-
+#include "E_Nm.h"
+#include "e_dbus_private.h"
EAPI E_NM_Variant *
e_nm_variant_new(int type, const void *value)
{
#include "E_Nm.h"
#include "e_nm_private.h"
-
+#include "e_dbus_private.h"
#include <string.h>
static const Property nms_properties[] = {
nmsi = d->object;
if (dbus_error_is_set(err))
{
- printf("Error: %s - %s\n", err->name, err->message);
+ E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
dbus_message_get_args(msg, &err, DBUS_TYPE_OBJECT_PATH, &conn, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err))
{
- printf("Error: %s - %s\n", err.name, err.message);
+ E_DBUS_LOG_ERR("%s - %s", err.name, err.message);
return;
}
switch (variant->type)
{
case 'a':
- printf("Error: No support for array of array\n");
+ E_DBUS_LOG_ERR("No support for array of array");
break;
case 's':
case 'o':
e_nms_dump(E_NMS *nms)
{
if (!nms) return;
- printf("E_NMS:\n");
- printf("unmanaged_devices:\n");
+ E_DBUS_LOG_INFO("E_NMS:");
+ E_DBUS_LOG_INFO("unmanaged_devices:");
if (nms->unmanaged_devices)
{
const char *dev;
ecore_list_first_goto(nms->unmanaged_devices);
while ((dev = ecore_list_next(nms->unmanaged_devices)))
- printf(" - %s\n", dev);
+ INFO(" - %s", dev);
}
- printf("hostname : %s\n", nms->hostname);
- printf("\n");
+ INFO("hostname : %s", nms->hostname);
+ INFO("");
}
EAPI int
{
if (dbus_error_is_set(err))
{
- printf("Error: %s - %s\n", err->name, err->message);
+ E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
}
else
{
- printf("Yay!\n");
+ E_DBUS_LOG_ERR("Yay!");
}
}
#include "E_Nm.h"
#include "e_nm_private.h"
-
+#include "e_dbus_private.h"
#include <string.h>
static void
d = data;
if (dbus_error_is_set(err))
{
- printf("Error: %s - %s\n", err->name, err->message);
+ E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
d = data;
if (dbus_error_is_set(err))
{
- printf("Error: %s - %s\n", err->name, err->message);
+ E_DBUS_LOG_ERR("%s - %s", err->name, err->message);
d->cb_func(d->data, NULL);
free(d);
return;
{
if (!conn) return;
- printf("E_NMS_Connection:\n");
- printf("service_name: %s\n", conn->service_name);
- printf("path : %s\n", conn->path);
- printf("\n");
+ E_DBUS_LOG_INFO("E_NMS_Connection:");
+ E_DBUS_LOG_INFO("service_name: %s", conn->service_name);
+ E_DBUS_LOG_INFO("path : %s", conn->path);
+ E_DBUS_LOG_INFO("");
}
EAPI int
#include "E_Notify.h"
#include "e_notify_private.h"
+#include "e_dbus_private.h"
+
static E_DBus_Connection *client_conn;
static int init_count = 0;
-
+int _e_dbus_notification_log_dom = -1;
+
EAPI int
e_notification_init(void)
{
e_dbus_shutdown();
return 0;
}
+
+ _e_dbus_notification_log_dom = eina_log_domain_register("e_dbus_notification",E_DBUS_COLOR_DEFAULT);
+
+ if(_e_dbus_notification_log_dom < 0)
+ {
+ E_DBUS_LOG_ERR("E-Dbus-notification Error: Impossible to create e_dbus_motification domain");
+ e_dbus_shutdown();
+ return 0;
+ }
return ++init_count;
}
e_notification_shutdown(void)
{
if (--init_count) return init_count;
+ eina_log_domain_unregister(_e_dbus_notification_log_dom);
e_dbus_connection_close(client_conn);
client_conn = NULL;
e_dbus_shutdown();
#include "E_Notify.h"
#include "E_Notification_Daemon.h"
#include "e_notify_private.h"
+#include "e_dbus_private.h"
#include <string.h>
static int e_notification_daemon_bus_init(E_Notification_Daemon *daemon);
if (dbus_error_is_set(err))
{
- printf("Error (request_name): %s\n", err->message);
+ ERR("E-dbus-notification Error (request_name): %s", err->message);
dbus_error_free(err);
return;
}
- printf("received response with signature: '%s'\n", dbus_message_get_signature(msg));
+ INFO("E-dbus-notification received response with signature: '%s'", dbus_message_get_signature(msg));
dbus_error_init(&new_err);
dbus_message_get_args(msg, &new_err, DBUS_TYPE_UINT32, &ret, DBUS_TYPE_INVALID);
if (dbus_error_is_set(&new_err))
{
- printf("Error (req name unmarshal): %s\n", new_err.message);
+ ERR("E-dbus-notification Error (req name unmarshal): %s", new_err.message);
dbus_error_free(&new_err);
return;
}
void e_notify_marshal_hint_image(DBusMessageIter *iter, E_Notification_Image *img);
E_Notification_Image * e_notify_unmarshal_hint_image(DBusMessageIter *iter);
+
+extern int _e_dbus_notification_log_dom ;
+#undef ERR
+#undef INF
+#undef WARN
+#undef DBG
+
+#define DBG(...) EINA_LOG_DOM_DBG(_e_dbus_notification_log_dom , __VA_ARGS__)
+#define INFO(...) EINA_LOG_DOM_INFO(_e_dbus_notification_log_dom , __VA_ARGS__)
+#define WARN(...) EINA_LOG_DOM_WARN(_e_dbus_notification_log_dom , __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_e_dbus_notification_log_dom , __VA_ARGS__)
+
struct E_Notification_Image
{
int width;