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

[tor-commits] [bridgedb/master] Only log netstatus descriptor fields if they were parsed.



commit 40d39d583c7392111cbe57fa816c8e119180a74d
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Sun Jan 5 17:23:46 2014 +0000

    Only log netstatus descriptor fields if they were parsed.
    
     * CHANGE bridgedb.Bridges.parseStatusFile() to only log networkstatus
       descriptor fields if the parsers were actually able to parse
       them. Otherwise we waste a lot of log lines with blank values.
---
 lib/bridgedb/Bridges.py |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py
index 01de8b7..328cd2e 100644
--- a/lib/bridgedb/Bridges.py
+++ b/lib/bridgedb/Bridges.py
@@ -508,11 +508,12 @@ def parseStatusFile(networkstatusFile):
             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)
+            if descDigest:
+                logging.debug("  Descriptor: {0}".format(toHex(descDigest)))
+                logging.debug("  Timestamp:  {0}".format(timestamp))
+                logging.debug("  ORAddress:  {0}".format(ORaddr))
+                logging.debug("  ORport:     {0}".format(ORport))
+                logging.debug("  dirport:    {0}".format(dirport))
 
         elif ID and line.startswith("a "):
             try:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits