[next] telepathy-glib: Replace more printf() with DEBUG()

Simon McVittie smcv at kemper.freedesktop.org
Thu Sep 12 09:57:32 PDT 2013


Module: telepathy-glib
Branch: next
Commit: a0f78fab8b33eae3855f905b99c2b6f2228eef2b
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=a0f78fab8b33eae3855f905b99c2b6f2228eef2b

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Tue Mar 19 10:57:26 2013 +0100

Replace more printf() with DEBUG()

---

 telepathy-glib/group-mixin.c      |    8 ++++----
 telepathy-glib/properties-mixin.c |   25 ++++++-------------------
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/telepathy-glib/group-mixin.c b/telepathy-glib/group-mixin.c
index 06059bc..5907d74 100644
--- a/telepathy-glib/group-mixin.c
+++ b/telepathy-glib/group-mixin.c
@@ -1247,11 +1247,11 @@ tp_group_mixin_change_flags (GObject *obj,
           str_removed = group_flags_to_string (removed);
           str_flags = group_flags_to_string (mixin->group_flags);
 
-          DEBUG ("%s: emitting group flags changed\n"
+          DEBUG ("emitting group flags changed\n"
                   "  added    : %s\n"
                   "  removed  : %s\n"
                   "  flags now: %s\n",
-                  G_STRFUNC, str_added, str_removed, str_flags);
+                  str_added, str_removed, str_flags);
 
           g_free (str_added);
           g_free (str_removed);
@@ -1452,7 +1452,7 @@ emit_members_changed_signals (GObject *channel,
       local_str = member_array_to_string (mixin->handle_repo, local_pending);
       remote_str = member_array_to_string (mixin->handle_repo, remote_pending);
 
-      DEBUG ("%s: emitting members changed\n"
+      DEBUG ("emitting members changed\n"
               "  message       : \"%s\"\n"
               "  added         : %s\n"
               "  removed       : %s\n"
@@ -1460,7 +1460,7 @@ emit_members_changed_signals (GObject *channel,
               "  remote_pending: %s\n"
               "  actor         : %u\n"
               "  reason        : %u: %s\n",
-              G_STRFUNC, message, add_str, rem_str, local_str, remote_str,
+              message, add_str, rem_str, local_str, remote_str,
               actor, reason, group_change_reason_str (reason));
 
       g_free (add_str);
diff --git a/telepathy-glib/properties-mixin.c b/telepathy-glib/properties-mixin.c
index 1616006..c3dbc18 100644
--- a/telepathy-glib/properties-mixin.c
+++ b/telepathy-glib/properties-mixin.c
@@ -891,9 +891,8 @@ tp_properties_mixin_emit_changed (GObject *obj, const TpIntset *props)
 
   prop_arr = g_ptr_array_sized_new (len);
 
-  if (DEBUGGING)
-    printf ("%s: emitting properties changed for propert%s:\n",
-            G_STRFUNC, (len > 1) ? "ies" : "y");
+  DEBUG ("emitting properties changed for propert%s:\n",
+      (len > 1) ? "ies" : "y");
 
   tp_intset_fast_iter_init (&iter, props);
 
@@ -912,13 +911,7 @@ tp_properties_mixin_emit_changed (GObject *obj, const TpIntset *props)
 
       g_ptr_array_add (prop_arr, g_value_get_boxed (&prop_val));
 
-      if (DEBUGGING)
-        printf ("  %s\n", mixin_cls->signatures[prop_id].name);
-    }
-
-  if (DEBUGGING)
-    {
-      fflush (stdout);
+      DEBUG ("  %s\n", mixin_cls->signatures[prop_id].name);
     }
 
   tp_svc_properties_interface_emit_properties_changed (
@@ -958,9 +951,8 @@ tp_properties_mixin_emit_flags (GObject *obj, const TpIntset *props)
 
   prop_arr = g_ptr_array_sized_new (len);
 
-  if (DEBUGGING)
-    printf ("%s: emitting properties flags changed for propert%s:\n",
-            G_STRFUNC, (len > 1) ? "ies" : "y");
+  DEBUG ("emitting properties flags changed for propert%s:\n",
+      (len > 1) ? "ies" : "y");
 
   tp_intset_fast_iter_init (&iter, props);
 
@@ -987,18 +979,13 @@ tp_properties_mixin_emit_flags (GObject *obj, const TpIntset *props)
         {
           gchar *str_flags = property_flags_to_string (prop_flags);
 
-          printf ("  %s's flags now: %s\n",
+          DEBUG ("  %s's flags now: %s\n",
                   mixin_cls->signatures[prop_id].name, str_flags);
 
           g_free (str_flags);
         }
     }
 
-  if (DEBUGGING)
-    {
-      fflush (stdout);
-    }
-
   tp_svc_properties_interface_emit_property_flags_changed (
       (TpSvcPropertiesInterface *) obj, prop_arr);
 



More information about the telepathy-commits mailing list