[tor-commits] [bridgedb/master] Add more parser logging to Bridges.parseStatusFile().

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


commit 54c5063cae2057a92e813a314fec78da2a7960d4
Author: Isis Lovecruft <isis at torproject.org>
Date:   Tue Dec 10 11:20:37 2013 +0000

    Add more parser logging to Bridges.parseStatusFile().
    
     * FIXES part of #9377
---
 lib/bridgedb/Bridges.py |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py
index a080331..57f7a03 100644
--- a/lib/bridgedb/Bridges.py
+++ b/lib/bridgedb/Bridges.py
@@ -502,6 +502,14 @@ def parseStatusFile(networkstatusFile):
         if line.startswith("r "):
             (nickname, ID, descDigest, timestamp,
              ORaddr, ORport, dirport) = networkstatus.parseRLine(line)
+            logging.debug("Parsed networkstatus line:")
+            logging.debug("  Nickname:   %s" % nickname)
+            logging.debug("  Identity:   %s" % toHex(ID))
+            logging.debug("  Descriptor: %s" % descDigest)
+            logging.debug("  Timestamp:  %s" % timestamp)
+            logging.debug("  ORAddress:  %s" % ORaddr)
+            logging.debug("  ORport:     %s" % ORport)
+            logging.debug("  dirport:    %s" % dirport)
 
         elif ID and line.startswith("a "):
             try:
@@ -515,7 +523,9 @@ def parseStatusFile(networkstatusFile):
 
         elif ID and timestamp and line.startswith("s "):
             running, stable = networkstatus.parseSLine(line)
-
+            logging.debug("Bridges.parseStatusFile(): "\
+                          "yielding %s running=%s stable=%s oraddrs=%s ts=%s"
+                          % (toHex(ID), running, stable, or_addresses, timestamp))
             yield ID, running, stable, or_addresses, timestamp
 
             (nickname, ID, descDigest, timestamp, ORaddr, ORport, dirport,





More information about the tor-commits mailing list