[tor-commits] [bridgedb/master] Fix a log message in networkstatus.parseSLine() function.

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


commit 2a1e5dad2e70ba2e09a6b9480880f08aab408c67
Author: Isis Lovecruft <isis at torproject.org>
Date:   Fri Nov 22 01:23:23 2013 +0000

    Fix a log message in networkstatus.parseSLine() function.
    
    Before, it was only printing whatever was originally found in the
    networkstatus line, *not* which flags we had successfully parsed. Since
    we only actually care that we are correctly able to parse relevant
    flags, that is what the log message should contain.
---
 lib/bridgedb/parse/networkstatus.py |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/bridgedb/parse/networkstatus.py b/lib/bridgedb/parse/networkstatus.py
index 1cb54d3..a367b03 100644
--- a/lib/bridgedb/parse/networkstatus.py
+++ b/lib/bridgedb/parse/networkstatus.py
@@ -256,8 +256,14 @@ def parseSLine(line):
     stable  = 'Stable' in flags
     guard   = 'Guard' in flags
     valid   = 'Valid' in flags
-    
-    logging.debug("Parsed Flags: %s" % flags)
+
+    if (fast or running or stable or guard or valid):
+        logging.debug("Parsed Flags: %s%s%s%s%s"
+                      % ('Fast ' if fast else '',
+                         'Running ' if running else '',
+                         'Stable ' if stable else '',
+                         'Guard ' if guard else '',
+                         'Valid ' if valid else ''))
 
     # Right now, we only care about 'Running' and 'Stable'
     return running, stable





More information about the tor-commits mailing list