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.
This commit is contained in:
Dan Williams 2012-02-07 12:36:45 -06:00
parent 57bd84139f
commit 7f9fe7601e
2 changed files with 16 additions and 0 deletions

View file

@ -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);

View file

@ -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))