Use full object path string in default error/notify handlers.

Original commit message from CVS:
Use full object path string in default error/notify handlers.
This commit is contained in:
Wim Taymans 2002-11-20 21:13:07 +00:00
parent 08b7de807c
commit 20e44c6f57
2 changed files with 10 additions and 3 deletions

View file

@ -216,7 +216,9 @@ gst_element_real_get_property (GObject *object, guint prop_id, GValue *value, GP
void
gst_element_default_error (GObject *object, GstObject *orig, gchar *error)
{
g_print ("ERROR: %s: %s\n", GST_OBJECT_NAME (orig), error);
gchar *name = gst_object_get_path_string (orig);
g_print ("ERROR: %s: %s\n", name, error);
g_free (name);
}
typedef struct {

View file

@ -329,6 +329,7 @@ gst_object_default_deep_notify (GObject *object, GstObject *orig,
{
GValue value = { 0, }; /* the important thing is that value.type = 0 */
gchar *str = 0;
gchar *name = NULL;
if (pspec->flags & G_PARAM_READABLE) {
/* let's not print these out for excluded properties... */
@ -351,12 +352,16 @@ gst_object_default_deep_notify (GObject *object, GstObject *orig,
else {
str = g_strdup_value_contents (&value);
}
g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
name = gst_object_get_path_string (orig);
g_print ("%s: %s = %s\n", name, pspec->name, str);
g_free (name);
g_free (str);
g_value_unset (&value);
} else {
name = gst_object_get_path_string (orig);
g_warning ("Parameter %s not readable in %s.",
pspec->name, GST_OBJECT_NAME (orig));
pspec->name, name);
g_free (name);
}
}