[recipes] Reduce message levels



commit 7184a7900870f8469ccff5eb177d417c49a27dac
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 4 23:10:47 2017 -0500

    Reduce message levels
    
    Reduce all the messages that are expected to occur during
    normal operation from g_message to g_info, so they don't
    show up unless explicitly requested.

 src/gr-account.c         |    8 ++++----
 src/gr-app.c             |    2 +-
 src/gr-appdata.c         |    2 +-
 src/gr-details-page.c    |    2 +-
 src/gr-mail.c            |    4 ++--
 src/gr-recipe-exporter.c |    8 ++++----
 src/gr-recipe-importer.c |   14 +++++++-------
 src/gr-recipe-store.c    |   42 +++++++++++++++++++++---------------------
 src/gr-shopping-page.c   |    2 +-
 src/gr-utils.c           |    2 +-
 10 files changed, 43 insertions(+), 43 deletions(-)
---
diff --git a/src/gr-account.c b/src/gr-account.c
index 8f4b045..fe48ec5 100644
--- a/src/gr-account.c
+++ b/src/gr-account.c
@@ -105,7 +105,7 @@ account_response (GDBusConnection *connection,
         else {
                 g_autoptr(GError) error = NULL;
 
-                g_message ("Got an error from the Account portal");
+                g_info ("Got an error from the Account portal");
                 g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
                              _("Got an error from Account portal"));
 
@@ -128,7 +128,7 @@ window_handle_exported (GtkWindow  *window,
 
         cbdata->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
        if (!cbdata->connection) {
-                g_message ("Could not talk to D-Bus: %s", error->message);
+                g_info ("Could not talk to D-Bus: %s", error->message);
                 cbdata->callback (NULL, NULL, NULL, cbdata->data, error);
                 free_callback_data (cbdata);
                 return;
@@ -150,7 +150,7 @@ window_handle_exported (GtkWindow  *window,
                                            &error);
 
         if (!ret) {
-                g_message ("Could not talk to Account portal: %s", error->message);
+                g_info ("Could not talk to Account portal: %s", error->message);
                 cbdata->callback (NULL, NULL, NULL, cbdata->data, error);
                 free_callback_data (cbdata);
                 return;
@@ -208,7 +208,7 @@ got_account_info (const char  *id,
         store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
 
         if (error) {
-                g_message ("Failed to get account information: %s", error->message);
+                g_info ("Failed to get account information: %s", error->message);
                id = g_get_user_name ();
                name = g_get_real_name ();
                image_path = NULL;
diff --git a/src/gr-app.c b/src/gr-app.c
index ba450c5..7bf7c86 100644
--- a/src/gr-app.c
+++ b/src/gr-app.c
@@ -252,7 +252,7 @@ load_application_css (GrApp *app)
         else
                 path = resource;
 
-        g_message ("Loading application CSS from %s", path);
+        g_info ("Loading application CSS from %s", path);
 
         css = gr_cuisine_get_css (path);
 
diff --git a/src/gr-appdata.c b/src/gr-appdata.c
index 4cc3a69..c46eddd 100644
--- a/src/gr-appdata.c
+++ b/src/gr-appdata.c
@@ -260,7 +260,7 @@ get_release_info (const char *new_version,
 
         file = g_build_filename (DATADIR, "appdata", "org.gnome.Recipes.appdata.xml", NULL);
 
-        g_message ("Loading release information for version %s to %s from %s", old_version, new_version, 
file);
+        g_info ("Loading release information for version %s to %s from %s", old_version, new_version, file);
 
         return parse_appdata (file, new_version, old_version);
 }
diff --git a/src/gr-details-page.c b/src/gr-details-page.c
index 165514b..3ebefd5 100644
--- a/src/gr-details-page.c
+++ b/src/gr-details-page.c
@@ -268,7 +268,7 @@ save_notes (gpointer data)
 
         store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
         if (!gr_recipe_store_update_recipe (store, page->recipe, id, &error)) {
-                g_message ("Error: %s", error->message);
+                g_warning ("Error: %s", error->message);
         }
 
 out:
diff --git a/src/gr-mail.c b/src/gr-mail.c
index fdfc282..5739d67 100644
--- a/src/gr-mail.c
+++ b/src/gr-mail.c
@@ -134,7 +134,7 @@ compose_mail_done (GObject      *source,
         reply = g_dbus_proxy_call_finish (G_DBUS_PROXY (source), result, &error);
         if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_INTERFACE) ||
             g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD)) {
-                g_message ("Email portal not present, falling back to mailto: url");
+                g_info ("Email portal not present, falling back to mailto: url");
                 send_mail_using_mailto (md);
                 return;
         }
@@ -161,7 +161,7 @@ window_handle_exported (GtkWindow  *window,
         proxy = get_mail_portal_proxy ();
 
         if (proxy == NULL) {
-                g_message ("Email portal not present, falling back to mailto: url");
+                g_info ("Email portal not present, falling back to mailto: url");
                 send_mail_using_mailto (md);
                 return;
         }
diff --git a/src/gr-recipe-exporter.c b/src/gr-recipe-exporter.c
index 2f0082c..2664a47 100644
--- a/src/gr-recipe-exporter.c
+++ b/src/gr-recipe-exporter.c
@@ -159,7 +159,7 @@ mail_done (GObject      *source,
         if (!gr_send_mail_finish (result, &error)) {
                 GObject *file_chooser;
 
-                g_message ("Sending mail failed: %s", error->message);
+                g_info ("Sending mail failed: %s", error->message);
 
                 file_chooser = (GObject *)gtk_file_chooser_native_new (_("Save the exported recipe"),
                                                                        GTK_WINDOW (exporter->window),
@@ -545,10 +545,10 @@ export_dialog_response (GtkWidget        *dialog,
                         GrRecipeExporter *exporter)
 {
         if (response_id == GTK_RESPONSE_CANCEL) {
-                g_message ("not exporting now");
+                g_info ("Not exporting now");
         }
         else if (response_id == GTK_RESPONSE_OK) {
-                g_message ("exporting %d recipes now", g_list_length (exporter->recipes));
+                g_info ("Exporting %d recipes now", g_list_length (exporter->recipes));
 
                 exporter->contribute = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(exporter->contribute_button));
 
@@ -779,7 +779,7 @@ gr_recipe_exporter_export_all (GrRecipeExporter *exporter,
 {
         collect_all_recipes (exporter);
 
-        g_message ("Exporting %d recipes", g_list_length (exporter->recipes));
+        g_info ("Exporting %d recipes", g_list_length (exporter->recipes));
 
         if (exporter->recipes == NULL)
                 return;
diff --git a/src/gr-recipe-importer.c b/src/gr-recipe-importer.c
index 1265ae8..fb0b551 100644
--- a/src/gr-recipe-importer.c
+++ b/src/gr-recipe-importer.c
@@ -346,13 +346,13 @@ recipe_dialog_response (GtkWidget        *dialog,
                         GrRecipeImporter *importer)
 {
         if (response_id == GTK_RESPONSE_CANCEL) {
-                g_message ("Not importing recipe %s", importer->recipe_name);
+                g_info ("Not importing recipe %s", importer->recipe_name);
                 gtk_widget_destroy (dialog);
         }
         else {
                 g_free (importer->recipe_name);
                 importer->recipe_name = g_strdup (g_object_get_data (G_OBJECT (dialog), "name"));
-                g_message ("Renaming recipe to %s while importing", importer->recipe_name);
+                g_info ("Renaming recipe to %s while importing", importer->recipe_name);
                 gtk_widget_destroy (dialog);
                 if (!import_recipe (importer))
                         return;
@@ -491,7 +491,7 @@ next:
 
         recipe = gr_recipe_store_get_recipe (store, importer->recipe_id);
         if (!recipe) {
-                g_message ("Recipe %s not yet known; importing", importer->recipe_id);
+                g_info ("Recipe %s not yet known; importing", importer->recipe_id);
                 if (!import_recipe (importer))
                         return FALSE;
                 goto next;
@@ -610,7 +610,7 @@ chef_dialog_response (GtkWidget        *dialog,
                       GrRecipeImporter *importer)
 {
         if (response_id == GTK_RESPONSE_CANCEL) {
-                g_message ("Chef %s known after all; not importing", importer->chef_id);
+                g_info ("Chef %s known after all; not importing", importer->chef_id);
                 gtk_widget_destroy (dialog);
         }
         else {
@@ -628,7 +628,7 @@ chef_dialog_response (GtkWidget        *dialog,
                 importer->chef_fullname = g_strdup (gtk_entry_get_text (GTK_ENTRY 
(importer->new_chef_fullname)));
                 importer->chef_description = get_text_view_text (GTK_TEXT_VIEW 
(importer->new_chef_description));
 
-                g_message ("Renaming chef to %s while importing", importer->chef_id);
+                g_info ("Renaming chef to %s while importing", importer->chef_id);
                 gtk_widget_destroy (dialog);
                 if (!import_chef (importer))
                         return;
@@ -721,7 +721,7 @@ next:
         g_hash_table_insert (importer->chef_id_map, g_strdup (importer->chef_id), g_strdup (id));
         chef = gr_recipe_store_get_chef (store, id);
         if (!chef) {
-                g_message ("Chef %s not yet known; importing", id);
+                g_info ("Chef %s not yet known; importing", id);
                 import_chef (importer);
                 goto next;
         }
@@ -729,7 +729,7 @@ next:
         if (g_strcmp0 (importer->chef_fullname, gr_chef_get_fullname (chef)) == 0 &&
             g_strcmp0 (importer->chef_name, gr_chef_get_name (chef)) == 0 &&
             g_strcmp0 (importer->chef_description, gr_chef_get_description (chef)) == 0) {
-                g_message ("Chef %s already known, not importing", id);
+                g_info ("Chef %s already known, not importing", id);
                 goto next;
         }
 
diff --git a/src/gr-recipe-store.c b/src/gr-recipe-store.c
index a0b4aa2..724562e 100644
--- a/src/gr-recipe-store.c
+++ b/src/gr-recipe-store.c
@@ -127,10 +127,10 @@ load_recipes (GrRecipeStore *self,
                 if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
                         g_error ("Failed to load recipe db: %s", error->message);
                 else
-                        g_message ("No recipe db at: %s", path);
+                        g_info ("No recipe db at: %s", path);
                 return FALSE;
         }
-        g_message ("Load recipe db: %s", path);
+        g_info ("Load recipe db: %s", path);
 
         groups = g_key_file_get_groups (keyfile, &length);
         for (i = 0; i < length; i++) {
@@ -430,7 +430,7 @@ save_recipes (GrRecipeStore *self)
                 dir = get_user_data_dir ();
         path = g_build_filename (dir, "recipes.db", NULL);
 
-        g_message ("Save recipe db: %s", path);
+        g_info ("Save recipe db: %s", path);
 
         keys = g_hash_table_get_keys (self->recipes);
         keys = g_list_sort (keys, (GCompareFunc)strcmp);
@@ -545,11 +545,11 @@ load_picks (GrRecipeStore *self,
                 if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
                         g_error ("Failed to load picks db: %s", error->message);
                 else
-                        g_message ("No picks db at: %s", path);
+                        g_info ("No picks db at: %s", path);
                 return FALSE;
         }
 
-        g_message ("Load picks db: %s", path);
+        g_info ("Load picks db: %s", path);
 
         self->picks = g_key_file_get_string_list (keyfile, "Content", "Picks", NULL, &error);
         if (error) {
@@ -596,11 +596,11 @@ load_favorites (GrRecipeStore *self,
                 if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
                         g_error ("Failed to load favorites db: %s", error->message);
                 else
-                        g_message ("No favorites db at: %s", path);
+                        g_info ("No favorites db at: %s", path);
                 return FALSE;
         }
 
-        g_message ("Load favorites db: %s", path);
+        g_info ("Load favorites db: %s", path);
 
         if (g_key_file_has_key (keyfile, "Content", "Recipes", NULL))
                 key = "Recipes";
@@ -640,7 +640,7 @@ save_favorites (GrRecipeStore *self)
 
         path = g_build_filename (get_user_data_dir (), "favorites.db", NULL);
 
-        g_message ("Save favorites db: %s", path);
+        g_info ("Save favorites db: %s", path);
 
         g_key_file_set_string_list (keyfile, "Content", "Recipes", (const char * const *)self->favorites, 
g_strv_length (self->favorites));
 
@@ -674,11 +674,11 @@ load_shopping (GrRecipeStore *self,
                 if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
                         g_error ("Failed to load shopping db: %s", error->message);
                 else
-                        g_message ("No shopping db at: %s", path);
+                        g_info ("No shopping db at: %s", path);
                 return FALSE;
         }
 
-        g_message ("Load shopping db: %s", path);
+        g_info ("Load shopping db: %s", path);
 
         self->shopping = g_key_file_get_string_list (keyfile, "Content", "Recipes", &len1, &error);
         if (error) {
@@ -724,7 +724,7 @@ save_shopping (GrRecipeStore *self)
 
         path = g_build_filename (get_user_data_dir (), "shopping.db", NULL);
 
-        g_message ("Save shopping db: %s", path);
+        g_info ("Save shopping db: %s", path);
 
         g_key_file_set_string_list (keyfile, "Content", "Recipes", (const char * const *)self->shopping, 
g_strv_length (self->shopping));
 
@@ -767,11 +767,11 @@ load_chefs (GrRecipeStore *self,
                 if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
                         g_error ("Failed to load chefs db: %s", error->message);
                 else
-                        g_message ("No chefs db at: %s", path);
+                        g_info ("No chefs db at: %s", path);
                 return FALSE;
         }
 
-        g_message ("Load chefs db: %s", path);
+        g_info ("Load chefs db: %s", path);
 
         groups = g_key_file_get_groups (keyfile, &length);
         for (i = 0; i < length; i++) {
@@ -861,7 +861,7 @@ save_chefs (GrRecipeStore *store)
                 dir = get_user_data_dir ();
         path = g_build_filename (dir, "chefs.db", NULL);
 
-        g_message ("Save chefs db: %s", path);
+        g_info ("Save chefs db: %s", path);
 
         keys = g_hash_table_get_keys (store->chefs);
         keys = g_list_sort (keys, (GCompareFunc)strcmp);
@@ -909,7 +909,7 @@ save_user (GrRecipeStore *self)
 
         path = g_build_filename (get_user_data_dir (), "user", NULL);
 
-        g_message ("Save user id: %s", path);
+        g_info ("Save user id: %s", path);
 
         if (self->user == NULL || self->user[0] == '\0') {
                 g_unlink (path);
@@ -942,7 +942,7 @@ load_user (GrRecipeStore *self,
                 return FALSE;
         }
 
-        g_message ("Load user id: %s", path);
+        g_info ("Load user id: %s", path);
 
         self->user = g_strdup (contents);
 
@@ -974,14 +974,14 @@ gr_recipe_store_init (GrRecipeStore *self)
         if (g_getenv ("RECIPES_DATA_DIR")) {
                 const char *dir = g_getenv ("RECIPES_DATA_DIR");
 
-                g_message ("Loading data from RECIPES_DATA_DIR: %s", dir);
+                g_info ("Loading data from RECIPES_DATA_DIR: %s", dir);
 
                 load_recipes (self, dir, FALSE);
                 load_chefs (self, dir, FALSE);
                 load_picks (self, dir);
 
-                g_message ("%d recipes loaded", g_hash_table_size (self->recipes));
-                g_message ("%d chefs loaded", g_hash_table_size (self->chefs));
+                g_info ("%d recipes loaded", g_hash_table_size (self->recipes));
+                g_info ("%d chefs loaded", g_hash_table_size (self->chefs));
 
                 return;
         }
@@ -1023,8 +1023,8 @@ gr_recipe_store_init (GrRecipeStore *self)
                 save_chefs (self);
         }
 
-        g_message ("%d recipes loaded", g_hash_table_size (self->recipes));
-        g_message ("%d chefs loaded", g_hash_table_size (self->chefs));
+        g_info ("%d recipes loaded", g_hash_table_size (self->recipes));
+        g_info ("%d chefs loaded", g_hash_table_size (self->chefs));
 }
 
 static guint add_signal;
diff --git a/src/gr-shopping-page.c b/src/gr-shopping-page.c
index 50c1c69..d3f7c16 100644
--- a/src/gr-shopping-page.c
+++ b/src/gr-shopping-page.c
@@ -717,7 +717,7 @@ mail_done (GObject      *source,
                 GObject *file_chooser;
                 GtkWidget *window;
 
-                g_message ("Sending mail failed: %s", error->message);
+                g_info ("Sending mail failed: %s", error->message);
 
                 window = gtk_widget_get_ancestor (GTK_WIDGET (page), GTK_TYPE_APPLICATION_WINDOW);
                 file_chooser = (GObject *)gtk_file_chooser_native_new (_("Save the shopping list"),
diff --git a/src/gr-utils.c b/src/gr-utils.c
index 640c8dc..3d05ded 100644
--- a/src/gr-utils.c
+++ b/src/gr-utils.c
@@ -643,7 +643,7 @@ import_image (const char *path)
         else
                 format_name = g_strdup ("png");
 
-        g_debug ("Loading %s (format %s), importing to %s\n", path, format_name, imported);
+        g_info ("Loading %s (format %s), importing to %s\n", path, format_name, imported);
         oriented = gdk_pixbuf_apply_embedded_orientation (pixbuf);
 
         if (!gdk_pixbuf_save (oriented, imported, format_name, &error, NULL)) {


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