[gnome-software/wip/hughsie/libxmlb: 6/10] Remove some over-verbose debugging



commit 95b7dee294ab6ef9e7be8f46beb3d7248db0fa68
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 15 17:37:54 2018 +0100

    Remove some over-verbose debugging
    
    There is so much output you can't see the wood for the trees.

 lib/gs-app-list.c                            | 17 +++--------------
 lib/gs-app.c                                 | 11 +++--------
 lib/gs-debug.c                               |  5 +++++
 lib/gs-plugin-loader.c                       | 21 ---------------------
 plugins/core/gs-plugin-appstream.c           |  2 --
 plugins/core/gs-plugin-generic-updates.c     |  2 --
 plugins/core/gs-plugin-key-colors-metadata.c |  1 -
 plugins/core/gs-plugin-rewrite-resource.c    |  1 -
 plugins/flatpak/gs-flatpak.c                 |  5 +----
 plugins/flatpak/gs-plugin-flatpak.c          |  9 ++-------
 plugins/modalias/gs-plugin-modalias.c        |  1 -
 plugins/odrs/gs-plugin-odrs.c                |  6 +-----
 src/gs-common.c                              |  2 --
 src/gs-screenshot-image.c                    |  5 ++---
 src/gs-shell.c                               |  1 -
 15 files changed, 17 insertions(+), 72 deletions(-)
---
diff --git a/lib/gs-app-list.c b/lib/gs-app-list.c
index 2a1aeb9c..66ae6bb6 100644
--- a/lib/gs-app-list.c
+++ b/lib/gs-app-list.c
@@ -310,12 +310,10 @@ gs_app_list_check_for_duplicate (GsAppList *list, GsApp *app)
                        GsApp *app_tmp = g_ptr_array_index (list->array, i);
                        if (!gs_app_has_quirk (app, GS_APP_QUIRK_IS_WILDCARD))
                                continue;
+                       /* not adding exactly the same wildcard */
                        if (g_strcmp0 (gs_app_get_unique_id (app_tmp),
-                                      gs_app_get_unique_id (app)) == 0) {
-                               g_debug ("not adding exactly the same wildcard %s",
-                                        gs_app_get_unique_id (app_tmp));
+                                      gs_app_get_unique_id (app)) == 0)
                                return FALSE;
-                       }
                }
                return TRUE;
        }
@@ -338,10 +336,8 @@ gs_app_list_check_for_duplicate (GsAppList *list, GsApp *app)
 
        /* existing app is a wildcard */
        id_old = gs_app_get_unique_id (app_old);
-       if (gs_app_has_quirk (app_old, GS_APP_QUIRK_IS_WILDCARD)) {
-               g_debug ("adding %s as %s is a wildcard", id, id_old);
+       if (gs_app_has_quirk (app_old, GS_APP_QUIRK_IS_WILDCARD))
                return TRUE;
-       }
 
        /* do a sanity check */
        if (!as_utils_unique_id_equal (id, id_old)) {
@@ -351,7 +347,6 @@ gs_app_list_check_for_duplicate (GsAppList *list, GsApp *app)
        }
 
        /* already exists */
-       g_debug ("not adding duplicate %s as %s already exists", id, id_old);
        return FALSE;
 }
 
@@ -851,9 +846,6 @@ gs_app_list_filter_duplicates (GsAppList *list, GsAppListFilterFlags flags)
                /* better? */
                if (flags != GS_APP_LIST_FILTER_FLAG_NONE) {
                        if (gs_app_list_filter_app_is_better (app, found, flags)) {
-                               g_debug ("using better (priority %u > %u)",
-                                        gs_app_get_priority (app),
-                                        gs_app_get_priority (found));
                                for (guint j = 0; j < keys->len; j++) {
                                        const gchar *key = g_ptr_array_index (keys, j);
                                        g_hash_table_insert (hash, g_strdup (key), app);
@@ -862,9 +854,6 @@ gs_app_list_filter_duplicates (GsAppList *list, GsAppListFilterFlags flags)
                                g_hash_table_add (kept_apps, app);
                                continue;
                        }
-                       g_debug ("ignoring worse duplicate (priority %u > %u)",
-                                gs_app_get_priority (app),
-                                gs_app_get_priority (found));
                        continue;
                }
                continue;
diff --git a/lib/gs-app.c b/lib/gs-app.c
index b0876744..5dd12bf9 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -262,7 +262,6 @@ gs_app_get_unique_id_unlocked (GsApp *app)
 
        /* hmm, do what we can */
        if (priv->unique_id == NULL || !priv->unique_id_valid) {
-               g_debug ("autogenerating unique-id for %s", priv->id);
                g_free (priv->unique_id);
                priv->unique_id = as_utils_unique_id_build (priv->scope,
                                                            priv->bundle_kind,
@@ -1029,12 +1028,8 @@ gs_app_set_state_internal (GsApp *app, AsAppState state)
                /* transient, so ignore */
                break;
        default:
-               if (priv->state_recover != state) {
-                       g_debug ("%s non-transient state now %s",
-                                gs_app_get_unique_id_unlocked (app),
-                                as_app_state_to_string (state));
+               if (priv->state_recover != state)
                        priv->state_recover = state;
-               }
                break;
        }
 
@@ -2352,8 +2347,6 @@ gs_app_set_license (GsApp *app, GsAppQuality quality, const gchar *license)
                    g_strcmp0 (tokens[i], "|") == 0)
                        continue;
                if (gs_app_get_license_token_is_nonfree (tokens[i])) {
-                       g_debug ("nonfree license from %s: '%s'",
-                                gs_app_get_id (app), tokens[i]);
                        priv->license_is_free = FALSE;
                        break;
                }
@@ -4554,6 +4547,8 @@ gs_app_subsume_metadata (GsApp *app, GsApp *donor)
        for (GList *l = keys; l != NULL; l = l->next) {
                const gchar *key = l->data;
                const gchar *value = gs_app_get_metadata_item (donor, key);
+               if (gs_app_get_metadata_item (app, key) != NULL)
+                       continue;
                gs_app_set_metadata (app, key, value);
        }
 }
diff --git a/lib/gs-debug.c b/lib/gs-debug.c
index efc01746..808cedfb 100644
--- a/lib/gs-debug.c
+++ b/lib/gs-debug.c
@@ -66,6 +66,11 @@ gs_log_writer_console (GLogLevelFlags log_level,
                }
        }
 
+       /* this is really verbose */
+       if (g_strcmp0 (log_domain, "dconf") == 0 &&
+           log_level == G_LOG_LEVEL_DEBUG)
+               return G_LOG_WRITER_HANDLED;
+
        /* make threadsafe */
        locker = g_mutex_locker_new (&debug->mutex);
        g_assert (locker != NULL);
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 01c6942f..5c75206e 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -2369,13 +2369,6 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
                                if (!gs_plugin_get_enabled (dep))
                                        continue;
                                if (gs_plugin_get_order (plugin) <= gs_plugin_get_order (dep)) {
-                                       g_debug ("%s [%u] to be ordered after %s [%u] "
-                                                "so promoting to [%u]",
-                                                gs_plugin_get_name (plugin),
-                                                gs_plugin_get_order (plugin),
-                                                gs_plugin_get_name (dep),
-                                                gs_plugin_get_order (dep),
-                                                gs_plugin_get_order (dep) + 1);
                                        gs_plugin_set_order (plugin, gs_plugin_get_order (dep) + 1);
                                        changes = TRUE;
                                }
@@ -2398,13 +2391,6 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
                                if (!gs_plugin_get_enabled (dep))
                                        continue;
                                if (gs_plugin_get_order (plugin) >= gs_plugin_get_order (dep)) {
-                                       g_debug ("%s [%u] to be ordered before %s [%u] "
-                                                "so promoting to [%u]",
-                                                gs_plugin_get_name (plugin),
-                                                gs_plugin_get_order (plugin),
-                                                gs_plugin_get_name (dep),
-                                                gs_plugin_get_order (dep),
-                                                gs_plugin_get_order (dep) + 1);
                                        gs_plugin_set_order (dep, gs_plugin_get_order (plugin) + 1);
                                        changes = TRUE;
                                }
@@ -2466,13 +2452,6 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
                                if (!gs_plugin_get_enabled (dep))
                                        continue;
                                if (gs_plugin_get_priority (plugin) <= gs_plugin_get_priority (dep)) {
-                                       g_debug ("%s [%u] is better than %s [%u] "
-                                                "so promoting to [%u]",
-                                                gs_plugin_get_name (plugin),
-                                                gs_plugin_get_priority (plugin),
-                                                gs_plugin_get_name (dep),
-                                                gs_plugin_get_priority (dep),
-                                                gs_plugin_get_priority (dep) + 1);
                                        gs_plugin_set_priority (plugin, gs_plugin_get_priority (dep) + 1);
                                        changes = TRUE;
                                }
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 61b8a416..67a36e25 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -698,7 +698,6 @@ gs_plugin_refine_from_pkgname (GsPlugin *plugin,
                g_autofree gchar *xpath = NULL;
                g_autoptr(GPtrArray) components = NULL;
 
-               g_debug ("searching appstream for pkg %s", pkgname);
                xpath = g_strdup_printf ("components/component/pkgname[text()='%s']/..",
                                         pkgname);
                components = xb_silo_query (priv->silo, xpath, 0, &error_local);
@@ -792,7 +791,6 @@ gs_plugin_refine_wildcard (GsPlugin *plugin,
                g_autoptr(GsApp) new = NULL;
 
                /* new app */
-               g_debug ("found component for wildcard %s", id);
                new = gs_appstream_create_app (plugin, priv->silo, component, error);
                if (new == NULL)
                        return FALSE;
diff --git a/plugins/core/gs-plugin-generic-updates.c b/plugins/core/gs-plugin-generic-updates.c
index 9e92be60..7b40a931 100644
--- a/plugins/core/gs-plugin-generic-updates.c
+++ b/plugins/core/gs-plugin-generic-updates.c
@@ -119,8 +119,6 @@ gs_plugin_refine (GsPlugin *plugin,
                const gchar *id = gs_app_get_unique_id (app_tmp);
                if (id == NULL)
                        id = gs_app_get_source_default (app_tmp);
-               g_debug ("moving %s to parent %s",
-                        id, gs_app_get_unique_id (app));
                gs_app_add_related (app, app_tmp);
                gs_app_list_remove (list, app_tmp);
        }
diff --git a/plugins/core/gs-plugin-key-colors-metadata.c b/plugins/core/gs-plugin-key-colors-metadata.c
index ba03a0e2..82490bea 100644
--- a/plugins/core/gs-plugin-key-colors-metadata.c
+++ b/plugins/core/gs-plugin-key-colors-metadata.c
@@ -76,7 +76,6 @@ gs_plugin_refine_app (GsPlugin *plugin,
 
                /* only replace if it's different */
                if (g_strcmp0 (css, css_new->str) != 0) {
-                       g_debug ("replacing %s with %s", css, css_new->str);
                        gs_app_set_metadata (app, keys[i], NULL);
                        gs_app_set_metadata (app, keys[i], css_new->str);
                }
diff --git a/plugins/core/gs-plugin-rewrite-resource.c b/plugins/core/gs-plugin-rewrite-resource.c
index 156035de..72f7028f 100644
--- a/plugins/core/gs-plugin-rewrite-resource.c
+++ b/plugins/core/gs-plugin-rewrite-resource.c
@@ -61,7 +61,6 @@ gs_plugin_refine_app (GsPlugin *plugin,
                        if (css_new == NULL)
                                return FALSE;
                        if (g_strcmp0 (css, css_new) != 0) {
-                               g_debug ("replacing %s with %s", css, css_new);
                                gs_app_set_metadata (app, keys[i], NULL);
                                gs_app_set_metadata (app, keys[i], css_new);
                        }
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index b24bf8c2..74f73ff0 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1637,7 +1637,6 @@ gs_flatpak_set_app_metadata (GsFlatpak *self,
                gs_flatpak_error_convert (error);
                return FALSE;
        }
-       g_debug ("runtime for %s is %s", name, runtime);
 
        /* we always get this, but it's a low bar... */
        gs_app_add_kudo (app, GS_APP_KUDO_SANDBOXED);
@@ -1730,10 +1729,8 @@ gs_plugin_refine_item_metadata (GsFlatpak *self,
                return TRUE;
 
        /* already done */
-       if (gs_app_has_kudo (app, GS_APP_KUDO_SANDBOXED)) {
-               g_debug ("skipping reading metadata");
+       if (gs_app_has_kudo (app, GS_APP_KUDO_SANDBOXED))
                return TRUE;
-       }
 
        /* this is quicker than doing network IO */
        installation_path = flatpak_installation_get_path (self->installation);
diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c
index ee01017b..d5435ecf 100644
--- a/plugins/flatpak/gs-plugin-flatpak.c
+++ b/plugins/flatpak/gs-plugin-flatpak.c
@@ -265,11 +265,8 @@ gs_plugin_flatpak_get_handler (GsPlugin *plugin, GsApp *app)
        if (object_id != NULL) {
                for (guint i = 0; i < priv->flatpaks->len; i++) {
                        GsFlatpak *flatpak = g_ptr_array_index (priv->flatpaks, i);
-                       if (g_strcmp0 (gs_flatpak_get_id (flatpak), object_id) == 0) {
-                               g_debug ("chose %s using ID",
-                                        gs_flatpak_get_id (flatpak));
+                       if (g_strcmp0 (gs_flatpak_get_id (flatpak), object_id) == 0)
                                return flatpak;
-                       }
                }
        }
 
@@ -277,10 +274,8 @@ gs_plugin_flatpak_get_handler (GsPlugin *plugin, GsApp *app)
        for (guint i = 0; i < priv->flatpaks->len; i++) {
                GsFlatpak *flatpak = g_ptr_array_index (priv->flatpaks, i);
                if (_as_app_scope_is_compatible (gs_flatpak_get_scope (flatpak),
-                                                gs_app_get_scope (app))) {
-                       g_debug ("chose %s using scope", gs_flatpak_get_id (flatpak));
+                                                gs_app_get_scope (app)))
                        return flatpak;
-               }
        }
        return NULL;
 }
diff --git a/plugins/modalias/gs-plugin-modalias.c b/plugins/modalias/gs-plugin-modalias.c
index 6ca36511..63c7880a 100644
--- a/plugins/modalias/gs-plugin-modalias.c
+++ b/plugins/modalias/gs-plugin-modalias.c
@@ -109,7 +109,6 @@ gs_plugin_modalias_matches (GsPlugin *plugin, const gchar *modalias)
                        return TRUE;
                }
        }
-       g_debug ("no match for %s", modalias);
        return FALSE;
 }
 
diff --git a/plugins/odrs/gs-plugin-odrs.c b/plugins/odrs/gs-plugin-odrs.c
index 505adfba..0c97f0c4 100644
--- a/plugins/odrs/gs-plugin-odrs.c
+++ b/plugins/odrs/gs-plugin-odrs.c
@@ -498,12 +498,9 @@ gs_plugin_odrs_refine_ratings (GsPlugin *plugin,
        for (guint i = 0; i < reviewable_ids->len; i++) {
                const gchar *id = g_ptr_array_index (reviewable_ids, i);
                GArray *ratings_tmp = g_hash_table_lookup (priv->ratings, id);
-               if (ratings_tmp == NULL) {
-                       g_debug ("no ratings results for %s", id);
+               if (ratings_tmp == NULL)
                        continue;
-               }
                /* copy into accumulator array */
-               g_debug ("using ratings results for %s", id);
                for (guint j = 0; j < 6; j++)
                        ratings_raw[j] += g_array_index (ratings_tmp, guint32, j);
                cnt++;
@@ -645,7 +642,6 @@ gs_plugin_odrs_fetch_for_app (GsPlugin *plugin, GsApp *app, GError **error)
                                                error);
        if (reviews == NULL)
                return NULL;
-       g_debug ("odrs returned: %s", msg->response_body->data);
 
        /* save to the cache */
        if (!g_file_set_contents (cachefn,
diff --git a/src/gs-common.c b/src/gs-common.c
index 0eb7a36b..be5dc087 100644
--- a/src/gs-common.c
+++ b/src/gs-common.c
@@ -350,8 +350,6 @@ gs_utils_widget_set_css_internal (GtkWidget *widget,
        GtkStyleContext *context;
        g_autoptr(GtkCssProvider) provider = NULL;
 
-       g_debug ("using custom CSS %s", css);
-
        /* set the custom CSS class */
        context = gtk_widget_get_style_context (widget);
        gtk_style_context_add_class (context, class_name);
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index 24c4177a..90a2a1b8 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -506,10 +506,9 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
                age_max = g_settings_get_uint (ssimg->settings,
                                               "screenshot-cache-age-maximum");
                file = g_file_new_for_path (ssimg->filename);
-               if (age_max > 0 && gs_utils_get_file_age (file) < age_max) {
-                       g_debug ("image new enough, not re-requesting from server");
+               /* image new enough, not re-requesting from server */
+               if (age_max > 0 && gs_utils_get_file_age (file) < age_max)
                        return;
-               }
        }
 
        /* if we're not showing a full-size image, we try loading a blurred
diff --git a/src/gs-shell.c b/src/gs-shell.c
index de586a79..1ce69fd7 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -1878,7 +1878,6 @@ gs_shell_rescan_events (GsShell *shell)
        }
 
        /* nothing to show */
-       g_debug ("no events to show");
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "notification_event"));
        gtk_revealer_set_reveal_child (GTK_REVEALER (widget), FALSE);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]