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

[tor-commits] [ooni-probe/master] Avoid logging to stdout twice.



commit cff756fd2b2120f54562f44152c7a6736207cc07
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Sun Oct 7 16:07:26 2012 +0000

    Avoid logging to stdout twice.
    (Since we now use trial as a base for test running we no longer
    have to attach logging to stdout, because trial does it for us!)
---
 ooni/runner.py    |    1 -
 ooni/utils/log.py |    6 +-----
 2 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/ooni/runner.py b/ooni/runner.py
index 81272eb..ebeb4c5 100644
--- a/ooni/runner.py
+++ b/ooni/runner.py
@@ -208,7 +208,6 @@ class ORunner(object):
         result.done()
 
     def run(self):
-        #log.startLogging(sys.stdout)
         log.start()
 
         self.reporterFactory.options = self.options
diff --git a/ooni/utils/log.py b/ooni/utils/log.py
index b5e1363..eef50d8 100644
--- a/ooni/utils/log.py
+++ b/ooni/utils/log.py
@@ -73,7 +73,7 @@ class OONILogObserver(log.FileLogObserver):
         util.untilConcludes(self.write, timeStr + " " + msgStr)
         util.untilConcludes(self.flush)
 
-def start(logfile=None, logstdout=True, verbosity=None):
+def start(logfile=None, verbosity=None):
     if log.defaultObserver:
         verbosity = _get_log_level(verbosity)
 
@@ -81,10 +81,6 @@ def start(logfile=None, logstdout=True, verbosity=None):
         file = open(logfile, 'a') if logfile else stderr
         OONILogObserver(file, "info").start()
 
-        if logstdout is True:
-            observerooni = OONILogObserver(stdout, verbosity)
-            log.addObserver(observerooni.emit)
-
         log.msg("Starting OONI...")
 
 def debug(message, level="debug", **kw):

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