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

[tor-commits] [arm/master] Using new argument parsing for debug mode



commit c0da0d10c5599310001055e58e046d6986361615
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Sep 8 16:15:42 2013 -0700

    Using new argument parsing for debug mode
    
    Another pretty direct replacement.
---
 arm/starter.py |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arm/starter.py b/arm/starter.py
index e2bf175..c6c86c5 100644
--- a/arm/starter.py
+++ b/arm/starter.py
@@ -294,7 +294,6 @@ def _dumpConfig():
 def main():
   startTime = time.time()
   param = dict([(key, None) for key in CONFIG.keys()])
-  isDebugMode = False
 
   # attempts to fetch attributes for parsing tor's logs, configuration, etc
   
@@ -334,13 +333,12 @@ def main():
     sys.exit()
   
   for opt, arg in opts:
-    if opt in ("-d", "--debug"): isDebugMode = True # dumps all logs
-    elif opt in ("-b", "--blind"):
+    if opt in ("-b", "--blind"):
       param["startup.blindModeEnabled"] = True        # prevents connection lookups
     elif opt in ("-e", "--event"):
       param["startup.events"] = arg                   # set event flags
   
-  if isDebugMode:
+  if args.debug:
     try:
       stem_logger = stem.util.log.get_logger()
       
@@ -470,7 +468,7 @@ def main():
   _loadConfigurationDescriptions(pathPrefix)
   
   # dump tor and arm configuration when in debug mode
-  if isDebugMode:
+  if args.debug:
     stem.util.log.notice("Saving a debug log to '%s' (please check it for sensitive information before sharing)" % LOG_DUMP_PATH)
     _dumpConfig()
   



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