[tor-commits] [sbws/master] relayprioritizer: low logging levels.

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


commit e268c3909b074dc972343f1666011f890850bfd1
Author: juga0 <juga at riseup.net>
Date:   Sun Dec 9 08:14:29 2018 +0000

    relayprioritizer: low logging levels.
    
    The time it took to run prioritize function is not relevant for
    the operator.
    After several days, prioritiy would be adjusted for many relays,
    so don't log it.
    We can have different debug verbose levels in the future.
---
 sbws/lib/relayprioritizer.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/sbws/lib/relayprioritizer.py b/sbws/lib/relayprioritizer.py
index 3a635f0..8d3b0c5 100644
--- a/sbws/lib/relayprioritizer.py
+++ b/sbws/lib/relayprioritizer.py
@@ -69,10 +69,11 @@ class RelayPrioritizer:
                     # will come back to them sooner to try again.
                     assert result.freshness_reduction_factor >= 0.0
                     assert result.freshness_reduction_factor <= 1.0
-                    log.debug('Cutting freshness for a %s result by %d%% for '
-                              '%s', result.type.value,
-                              result.freshness_reduction_factor * 100,
-                              relay.nickname)
+                    # After several days, these would log many relays.
+                    # log.debug('Cutting freshness for a %s result by %d%% for'
+                    #           ' %s', result.type.value,
+                    #           result.freshness_reduction_factor * 100,
+                    #           relay.nickname)
                     freshness *= max(1.0-result.freshness_reduction_factor, 0)
                 priority += freshness
             relay.priority = priority
@@ -83,7 +84,7 @@ class RelayPrioritizer:
                      self.min_to_return)
         fn_tstop = Decimal(time.time())
         fn_tdelta = (fn_tstop - fn_tstart) * 1000
-        log.info('Spent %f msecs calculating relay best priority', fn_tdelta)
+        log.debug('Spent %f msecs calculating relay best priority', fn_tdelta)
         # Finally, slowly return the relays to the caller (after removing the
         # priority member we polluted the variable with ...)
         for relay in relays[0:cutoff]:





More information about the tor-commits mailing list