diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-04-12 18:12:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-04-12 18:12:49 -0400 |
commit | 311aca5a3472cd318b72ca21d7a530182154e75c (patch) | |
tree | c31ca2855df8bf1d84a2d5a6fcf2cabdbf742b6c /src/or/routerlist.c | |
parent | 8aec982f910f918785158038e5afafe55f869372 (diff) | |
download | tor-311aca5a3472cd318b72ca21d7a530182154e75c.tar.gz tor-311aca5a3472cd318b72ca21d7a530182154e75c.zip |
Log bandwidth_weight_rule_t as a string, not an integer.
I'm adding this because I can never remember what stuff like 'rule 3'
means. That's the one where if somebody goes limp or taps out, the
fight is over, right?
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 0173c27e4e..13123e4411 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1577,7 +1577,8 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl, if (smartlist_len(sl) == 0) { log_info(LD_CIRC, "Empty routerlist passed in to consensus weight node " - "selection for rule %d", rule); + "selection for rule %s", + bandwidth_weight_rule_to_string(rule)); return NULL; } @@ -1695,15 +1696,16 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl, weighted_bw += weight*this_bw; } - log_debug(LD_CIRC, "Choosing node for rule %d based on weights " - "Wg=%lf Wm=%lf We=%lf Wd=%lf with total bw %lf", rule, + log_debug(LD_CIRC, "Choosing node for rule %s based on weights " + "Wg=%lf Wm=%lf We=%lf Wd=%lf with total bw %lf", + bandwidth_weight_rule_to_string(rule), Wg, Wm, We, Wd, weighted_bw); /* If there is no bandwidth, choose at random */ if (DBL_TO_U64(weighted_bw) == 0) { log_warn(LD_CIRC, - "Weighted bandwidth is %lf in node selection for rule %d", - weighted_bw, rule); + "Weighted bandwidth is %lf in node selection for rule %s", + weighted_bw, bandwidth_weight_rule_to_string(rule)); tor_free(bandwidths); return smartlist_choose(sl); } @@ -1783,8 +1785,8 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, bandwidth_weight_rule_t rule, if (smartlist_len(sl) == 0) { log_info(LD_CIRC, - "Empty routerlist passed in to old node selection for rule %d", - rule); + "Empty routerlist passed in to old node selection for rule %s", + bandwidth_weight_rule_to_string(rule)); return NULL; } |