[tor-commits] [bridgedb/master] Clarify log messages in IPBasedDistributor.getBridgesForIP().

isis at torproject.org isis at torproject.org
Sun Jan 12 06:06:35 UTC 2014


commit af4b924ac51109b6f162523cf195686e006ac048
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sat Jan 11 16:33:36 2014 +0000

    Clarify log messages in IPBasedDistributor.getBridgesForIP().
---
 lib/bridgedb/Dist.py |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py
index 195ceb5..6728035 100644
--- a/lib/bridgedb/Dist.py
+++ b/lib/bridgedb/Dist.py
@@ -187,19 +187,25 @@ class IPBasedDistributor(bridgedb.Bridges.BridgeHolder):
                                        bridges returned in the response to the
                                        client. See :mod:`~bridgedb.Filters`.
         """
+        logging.info("Attempting to return %d bridges to client %s..."
+                     % (N, Util.logSafely(ip)))
+
         if not bridgeFilterRules:
             bridgeFilterRules=[]
-        logging.debug("getBridgesForIP(%s, %s, %s, %s",
-                Util.logSafely(ip), epoch, N, bridgeFilterRules)
 
         if not len(self.splitter):
-            logging.debug("bailing without splitter")
+            logging.warn("Bailing! Splitter has zero bridges!")
             return []
 
+        logging.debug("Bridges in splitter:\t%d" % len(self.splitter))
+        logging.debug("Client request epoch:\t%s" % epoch)
+        logging.debug("Active bridge filters:\t%s"
+                      % ' '.join([x.func_name for x in bridgeFilterRules]))
+
         area = self.areaMapper(ip)
+        logging.debug("IP mapped to area:\t%s"
+                      % Util.logSafely("{0}.0/24".format(area)))
 
-        logging.info("area is %s", Util.logSafely(area))
-        
         key1 = ''
         pos = 0
         n = self.nClusters
@@ -239,8 +245,6 @@ class IPBasedDistributor(bridgedb.Bridges.BridgeHolder):
                                              "Order-Bridges-In-Ring-%d"
                                              % clusterNum)
 
-        logging.debug("bridgeFilterRules: %s" % bridgeFilterRules)
-
         # try to find a cached copy
         ruleset = frozenset(bridgeFilterRules)
 





More information about the tor-commits mailing list