From d2c619762c11c857f7c10c87fa08676197cd3b8f Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 9 Feb 2007 13:41:24 +0000 Subject: [PATCH] gst/gstregistryxml.c (load_feature, load_plugin): Drop some normal-case logs down to LOG, raise errors to WARNING. Original commit message from CVS: 2007-02-09 Andy Wingo * gst/gstregistryxml.c (load_feature, load_plugin): Drop some normal-case logs down to LOG, raise errors to WARNING. (gst_registry_xml_read_cache): Don't log before calling a function that logs. * gst/gstregistry.c (gst_registry_finalize): Less debug on program exit (registry finalize). (gst_registry_add_plugin, gst_registry_add_feature): No need for a DEBUG log when we emit signals that people don't even have the chance to connect to. (gst_registry_scan_path_level): Less logging in the normal case. --- ChangeLog | 14 +++++++++++++ common | 2 +- gst/gstregistry.c | 12 +++++------ gst/gstregistryxml.c | 48 +++++++++++++++++++++----------------------- 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index bee8557878..57d19df74d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2007-02-09 Andy Wingo + + * gst/gstregistryxml.c (load_feature, load_plugin): Drop some + normal-case logs down to LOG, raise errors to WARNING. + (gst_registry_xml_read_cache): Don't log before calling a function + that logs. + + * gst/gstregistry.c (gst_registry_finalize): Less debug on program + exit (registry finalize). + (gst_registry_add_plugin, gst_registry_add_feature): No need for a + DEBUG log when we emit signals that people don't even have the + chance to connect to. + (gst_registry_scan_path_level): Less logging in the normal case. + 2007-02-05 Sebastian Dröge Patch by: Michal Benes diff --git a/common b/common index 8ba5dffb5e..de43a8f3c6 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 8ba5dffb5ee7e7daea1030f6b34bfef10f9801a3 +Subproject commit de43a8f3c629983e0bea0b8eb617e52ed35a6cda diff --git a/gst/gstregistry.c b/gst/gstregistry.c index e3599ee742..a94d109969 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -195,7 +195,7 @@ gst_registry_finalize (GObject * object) GstPlugin *plugin = p->data; if (plugin) { - GST_DEBUG_OBJECT (registry, "removing plugin %s", + GST_LOG_OBJECT (registry, "removing plugin %s", gst_plugin_get_name (plugin)); gst_object_unref (plugin); } @@ -211,7 +211,7 @@ gst_registry_finalize (GObject * object) GstPluginFeature *feature = f->data; if (feature) { - GST_DEBUG_OBJECT (registry, "removing feature %p (%s)", + GST_LOG_OBJECT (registry, "removing feature %p (%s)", feature, gst_plugin_feature_get_name (feature)); gst_object_unref (feature); } @@ -355,7 +355,7 @@ gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin) gst_object_sink (plugin); GST_OBJECT_UNLOCK (registry); - GST_DEBUG_OBJECT (registry, "emitting plugin-added for filename \"%s\"", + GST_LOG_OBJECT (registry, "emitting plugin-added for filename \"%s\"", GST_STR_NULL (plugin->filename)); g_signal_emit (G_OBJECT (registry), gst_registry_signals[PLUGIN_ADDED], 0, plugin); @@ -455,7 +455,7 @@ gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature) gst_object_sink (feature); GST_OBJECT_UNLOCK (registry); - GST_DEBUG_OBJECT (registry, "emitting feature-added for %s", feature->name); + GST_LOG_OBJECT (registry, "emitting feature-added for %s", feature->name); g_signal_emit (G_OBJECT (registry), gst_registry_signals[FEATURE_ADDED], 0, feature); @@ -862,9 +862,9 @@ gst_registry_scan_path_level (GstRegistry * registry, const gchar * path, } if (plugin->file_mtime == file_status.st_mtime && plugin->file_size == file_status.st_size) { - GST_DEBUG_OBJECT (registry, "file %s cached", filename); + GST_LOG_OBJECT (registry, "file %s cached", filename); plugin->flags &= ~GST_PLUGIN_FLAG_CACHED; - GST_DEBUG_OBJECT (registry, "marking plugin %p as registered as %s", + GST_LOG_OBJECT (registry, "marking plugin %p as registered as %s", plugin, filename); plugin->registered = TRUE; /* Update the file path on which we've seen this cached plugin diff --git a/gst/gstregistryxml.c b/gst/gstregistryxml.c index ad7f6cdd0e..3fab818f9e 100644 --- a/gst/gstregistryxml.c +++ b/gst/gstregistryxml.c @@ -275,7 +275,7 @@ load_feature (xmlTextReaderPtr reader) } while ((ret = xmlTextReaderRead (reader)) == 1) { if (xmlTextReaderDepth (reader) == depth) { - GST_DEBUG ("loaded feature %p with name %s", feature, feature->name); + GST_LOG ("loaded feature %p with name %s", feature, feature->name); return feature; } if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_ELEMENT && @@ -294,8 +294,7 @@ load_feature (xmlTextReaderPtr reader) int ret; ret = read_string (reader, &factory->details.longname, TRUE); - GST_DEBUG ("longname ret=%d, name=%s", - ret, factory->details.longname); + GST_LOG ("longname ret=%d, name=%s", ret, factory->details.longname); } else if (g_str_equal (tag, "class")) { read_string (reader, &factory->details.klass, TRUE); } else if (g_str_equal (tag, "description")) { @@ -375,7 +374,7 @@ load_plugin (xmlTextReaderPtr reader, GList ** feature_list) *feature_list = NULL; - GST_DEBUG ("creating new plugin and parsing"); + GST_LOG ("creating new plugin and parsing"); plugin = g_object_new (GST_TYPE_PLUGIN, NULL); @@ -392,69 +391,69 @@ load_plugin (xmlTextReaderPtr reader, GList ** feature_list) int ret; ret = read_string (reader, &plugin->desc.name, FALSE); - GST_DEBUG ("name ret=%d, name=%s", ret, plugin->desc.name); + GST_LOG ("name ret=%d, name=%s", ret, plugin->desc.name); if (!ret) break; } else if (g_str_equal (tag, "description")) { if (!read_string (reader, &plugin->desc.description, TRUE)) { - GST_DEBUG ("description field was invalid in registry"); + GST_WARNING ("description field was invalid in registry"); break; } - GST_DEBUG ("description %s", plugin->desc.description); + GST_LOG ("description %s", plugin->desc.description); } else if (g_str_equal (tag, "filename")) { if (!read_string (reader, &plugin->filename, FALSE)) { - GST_DEBUG ("filename field was invalid in registry"); + GST_WARNING ("filename field was invalid in registry"); break; } - GST_DEBUG ("filename %s", plugin->filename); + GST_LOG ("filename %s", plugin->filename); plugin->basename = g_path_get_basename (plugin->filename); } else if (g_str_equal (tag, "version")) { if (!read_string (reader, &plugin->desc.version, TRUE)) { - GST_DEBUG ("version field was invalid in registry"); + GST_WARNING ("version field was invalid in registry"); break; } - GST_DEBUG ("version %s", plugin->desc.version); + GST_LOG ("version %s", plugin->desc.version); } else if (g_str_equal (tag, "license")) { if (!read_string (reader, &plugin->desc.license, TRUE)) { - GST_DEBUG ("license field was invalid in registry"); + GST_WARNING ("license field was invalid in registry"); break; } - GST_DEBUG ("license %s", plugin->desc.license); + GST_LOG ("license %s", plugin->desc.license); } else if (g_str_equal (tag, "source")) { if (!read_string (reader, &plugin->desc.source, TRUE)) { - GST_DEBUG ("source field was invalid in registry"); + GST_WARNING ("source field was invalid in registry"); break; } - GST_DEBUG ("source %s", plugin->desc.source); + GST_LOG ("source %s", plugin->desc.source); } else if (g_str_equal (tag, "package")) { if (!read_string (reader, &plugin->desc.package, TRUE)) { - GST_DEBUG ("package field was invalid in registry"); + GST_WARNING ("package field was invalid in registry"); break; } - GST_DEBUG ("package %s", plugin->desc.package); + GST_LOG ("package %s", plugin->desc.package); } else if (g_str_equal (tag, "origin")) { if (!read_string (reader, &plugin->desc.origin, TRUE)) { - GST_DEBUG ("failed to read origin"); + GST_WARNING ("failed to read origin"); break; } } else if (g_str_equal (tag, "m32p")) { char *s; if (!read_string (reader, &s, FALSE)) { - GST_DEBUG ("failed to read mtime"); + GST_WARNING ("failed to read mtime"); break; } plugin->file_mtime = strtol (s, NULL, 0); - GST_DEBUG ("mtime %d", (int) plugin->file_mtime); + GST_LOG ("mtime %d", (int) plugin->file_mtime); g_free (s); } else if (g_str_equal (tag, "size")) { unsigned int x; if (read_uint (reader, &x)) { plugin->file_size = x; - GST_DEBUG ("file_size %" G_GINT64_FORMAT, (gint64) plugin->file_size); + GST_LOG ("file_size %" G_GINT64_FORMAT, (gint64) plugin->file_size); } else { - GST_DEBUG ("failed to read size"); + GST_WARNING ("failed to read size"); } } else if (g_str_equal (tag, "feature")) { GstPluginFeature *feature = load_feature (reader); @@ -464,13 +463,13 @@ load_plugin (xmlTextReaderPtr reader, GList ** feature_list) *feature_list = g_list_prepend (*feature_list, feature); } } else { - GST_DEBUG ("unknown tag %s", tag); + GST_WARNING ("unknown tag %s", tag); } } } gst_object_unref (plugin); - GST_DEBUG ("problem reading plugin"); + GST_WARNING ("problem reading plugin"); return NULL; } @@ -545,7 +544,6 @@ gst_registry_xml_read_cache (GstRegistry * registry, const char *location) if (plugin) { GList *g; - GST_DEBUG ("adding plugin %s", plugin->desc.name); gst_registry_add_plugin (registry, plugin); for (g = feature_list; g; g = g_list_next (g)) { gst_registry_add_feature (registry,