[tor-commits] [sbws/master] resultdump: format the main success/error msg

juga at torproject.org juga at torproject.org
Fri Dec 21 09:13:44 UTC 2018


commit 738dc1812221e75378c565fc534765decc26ed3d
Author: juga0 <juga at riseup.net>
Date:   Sun Dec 9 08:23:50 2018 +0000

    resultdump: format the main success/error msg
    
    that would be shown at info level.
---
 sbws/lib/resultdump.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/sbws/lib/resultdump.py b/sbws/lib/resultdump.py
index 3756f6f..3dce6fa 100644
--- a/sbws/lib/resultdump.py
+++ b/sbws/lib/resultdump.py
@@ -567,8 +567,17 @@ class ResultDump:
             return
         self.store_result(result)
         write_result_to_datadir(result, self.datadir)
-        log.info('%s %s finished measurement with %s', nick, fp[0:8],
-                 type(result).__name__)
+        if result.type == "success":
+            msg = "Success measuring {} ({}) via circuit {} and " \
+                  "destination {}".format(
+                    result.fingerprint, result.nickname, result.circ,
+                    result.dest_url)
+        else:
+            msg = "Error measuring {} ({}) via circuit {} and " \
+                  "destination {}: {}".format(
+                    result.fingerprint, result.nickname, result.circ,
+                    result.dest_url, result.msg)
+        log.info(msg)
 
     def enter(self):
         ''' Main loop for the ResultDump thread '''





More information about the tor-commits mailing list