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

[tor-commits] [ooni-probe/master] Enable info level logging on obfsproxy



commit 436a2323a92a79f198e77f384329b760ac1fca50
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Mon Sep 22 22:30:10 2014 +0200

    Enable info level logging on obfsproxy
---
 ooni/nettests/blocking/bridge_reachability.py |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/ooni/nettests/blocking/bridge_reachability.py b/ooni/nettests/blocking/bridge_reachability.py
index f472f75..b9aec33 100644
--- a/ooni/nettests/blocking/bridge_reachability.py
+++ b/ooni/nettests/blocking/bridge_reachability.py
@@ -51,7 +51,9 @@ class BridgeReachability(nettest.NetTestCase):
         self.tor_progress = 0
         self.timeout = int(self.localOptions['timeout'])
 
-        fd, self.logfile = tempfile.mkstemp()
+        fd, self.tor_logfile = tempfile.mkstemp()
+        os.close(fd)
+        fd, self.obfsproxy_logfile = tempfile.mkstemp()
         os.close(fd)
 
         self.report['error'] = None
@@ -64,6 +66,7 @@ class BridgeReachability(nettest.NetTestCase):
         self.report['tor_progress_summary'] = None
         self.report['tor_log'] = None
         self.report['obfsproxy_version'] = str(onion.obfsproxy_details['version'])
+        self.report['obfsproxy_log'] = None
         self.report['bridge_address'] = None
 
         self.bridge = self.input
@@ -144,8 +147,10 @@ class BridgeReachability(nettest.NetTestCase):
             self.report['error'] = 'missing-fteproxy'
             return
         elif transport_name and self.pyobfsproxy_bin:
-            config.ClientTransportPlugin = "%s exec %s managed" % (
-                transport_name, self.pyobfsproxy_bin)
+            config.ClientTransportPlugin = ("%s exec %s --log-min-severity info "
+                "--log-file %s managed") % (transport_name,
+                                            self.pyobfsproxy_bin,
+                                            self.obfsproxy_logfile)
             if onion.OBFSProxyVersion('0.2') > onion.obfsproxy_details['version']:
                 log.err(
                     "The obfsproxy version you are using appears to be outdated."
@@ -175,7 +180,7 @@ class BridgeReachability(nettest.NetTestCase):
 
         config.Bridge = self.bridge
         config.UseBridges = 1
-        config.log = ['notice stdout', 'notice file %s' % self.logfile]
+        config.log = ['notice stdout', 'notice file %s' % self.tor_logfile]
         config.save()
 
         def updates(prog, tag, summary):
@@ -205,8 +210,11 @@ class BridgeReachability(nettest.NetTestCase):
 
         @d.addCallback
         def write_log(_):
-            with open(self.logfile) as f:
+            with open(self.tor_logfile) as f:
                 self.report['tor_log'] = f.read()
-            os.remove(self.logfile)
+            os.remove(self.tor_logfile)
+            with open(self.obfsproxy_logfile) as f:
+                self.report['obfsproxy_log'] = f.read()
+            os.remove(self.obfsproxy_logfile)
 
         return d

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