[tor-commits] [ooni-probe/master] Fixed log.warn() and log.fail, but blocking on a way for tests to call

isis at torproject.org isis at torproject.org
Tue Dec 18 05:53:46 UTC 2012


commit 214c62697cdbe18a61b6e650b0d198e9f3cfb358
Author: Isis Lovecruft <isis at torproject.org>
Date:   Wed Nov 28 18:45:39 2012 +0000

    Fixed log.warn() and log.fail, but blocking on a way for tests to call
    a method to abort themselves and hand execution control back to the runner.
---
 ooni/utils/log.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ooni/utils/log.py b/ooni/utils/log.py
index 3b2b92a..a13feb9 100644
--- a/ooni/utils/log.py
+++ b/ooni/utils/log.py
@@ -49,8 +49,10 @@ def msg(msg, *arg, **kw):
 def debug(msg, *arg, **kw):
     txlog.msg(msg, logLevel=logging.DEBUG, *arg, **kw)
 
-def warn(msg, category=None, filename=None, lineno=None, *arg, **kw):
-    txlog.warnings.warn(msg, category, filename, lineno, *arg, **kw)
+def warn(msg, *arg, **kw):
+    txlog.logging.captureWarnings('true')
+    txlog.logging.warn(msg)
+    #txlog.showwarning()
 
 def err(msg, *arg, **kw):
     txlog.err("Error: " + str(msg), logLevel=logging.ERROR, *arg, **kw)
@@ -63,8 +65,8 @@ def exception(msg):
 def exception(*msg):
     logging.exception(msg)
 
-def fail(failure):
-    txlog.failure(failure)
+def fail(*failure):
+    logging.critical(failure)
 
 def catch(func):
     """





More information about the tor-commits mailing list