From 7f9fe7601eec33ca4dc14a8274dd9f8ae0efab26 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 7 Feb 2012 12:36:45 -0600 Subject: [PATCH] libnm-glib: better debugging of property accesses and updates Need to initialize libnm-util to get GValue transforms registered so the property values print out as strings. Then actually print some debugging information about properties. --- libnm-glib/nm-client.c | 2 ++ libnm-glib/nm-object.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 6c9eaa67e0..811b739d0d 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -1236,6 +1236,8 @@ constructed (GObject *object) DBusGConnection *connection; NMClientPrivate *priv; + nm_utils_init (NULL); + G_OBJECT_CLASS (nm_client_parent_class)->constructed (object); priv = NM_CLIENT_GET_PRIVATE (object); diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index 506b030773..62ed6745e5 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -757,7 +757,21 @@ handle_property_changed (NMObject *self, const char *dbus_name, GValue *value, g goto out; } +#if DEBUG + { + char *s; + s = g_strdup_value_contents (value); + g_message ("PC: %p (%s) prop (%s) '%s' value (%s) %s", + self, G_OBJECT_TYPE_NAME (self), + g_type_name (pspec->value_type), prop_name, + G_VALUE_TYPE_NAME (value), s); + g_free (s); + } +#endif if (pi->object_type) { +#if DEBUG + g_message (" Value is object type %s", g_type_name (pi->object_type)); +#endif if (G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) success = handle_object_property (self, pspec->name, value, pi, synchronously); else if (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH))