[folks] individual-aggregator: Add some more debug output



commit 406bc1264d3f19c54ea0c929e93814d263a90cc1
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Sep 12 23:07:33 2011 +0100

    individual-aggregator: Add some more debug output
    
    It turns out to be really useful to see what's being emitted by
    IndividualAggregator.individuals-changed-detailed.

 folks/individual-aggregator.vala |   45 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/folks/individual-aggregator.vala b/folks/individual-aggregator.vala
index b37a2a5..92a1ae5 100644
--- a/folks/individual-aggregator.vala
+++ b/folks/individual-aggregator.vala
@@ -701,6 +701,43 @@ public class Folks.IndividualAggregator : Object
           _changes = new HashMultiMap<Individual?, Individual?> ();
         }
 
+      /* Debug output. */
+      if (this._debug.debug_output_enabled == true)
+        {
+          debug ("Emitting individuals-changed-detailed with %u mappings:",
+              _changes.size);
+
+          foreach (var removed_ind in _changes.get_keys ())
+            {
+              foreach (var added_ind in _changes.get (removed_ind))
+                {
+                  debug ("    %s (%p) â %s (%p)",
+                      (removed_ind != null) ? removed_ind.id : "", removed_ind,
+                      (added_ind != null) ? added_ind.id : "", added_ind);
+
+                  if (removed_ind != null)
+                    {
+                      debug ("      Removed individual's personas:");
+
+                      foreach (var p in removed_ind.personas)
+                        {
+                          debug ("        %s (%p)", p.uid, p);
+                        }
+                    }
+
+                  if (added_ind != null)
+                    {
+                      debug ("      Added individual's personas:");
+
+                      foreach (var p in added_ind.personas)
+                        {
+                          debug ("        %s (%p)", p.uid, p);
+                        }
+                    }
+                }
+            }
+        }
+
       this.individuals_changed (_added.read_only_view, _removed.read_only_view,
           message, actor, reason);
       this.individuals_changed_detailed (_changes);
@@ -1174,7 +1211,13 @@ public class Folks.IndividualAggregator : Object
       var iter = replaced_individuals.map_iterator ();
       while (iter.next () == true)
         {
-          iter.get_key ().replace (iter.get_value ());
+          var old_ind = iter.get_key ();
+          var new_ind = iter.get_value ();
+
+          debug ("    %s (%p) â %s (%p)", old_ind.id, old_ind,
+              (new_ind != null) ? new_ind.id : "", new_ind);
+
+          old_ind.replace (new_ind);
         }
 
       /* Validate the link map. */



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