summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-03-17 04:08:04 +0000
committerNick Mathewson <nickm@torproject.org>2008-03-17 04:08:04 +0000
commitc33722b5c0399a46e0029dfbce251c16afea35bc (patch)
tree28a7886a813db61b163dc79ef1549f894c448d4e
parentada5a6696143fea6be1fe0ba01122e44eb30e134 (diff)
downloadtor-c33722b5c0399a46e0029dfbce251c16afea35bc.tar.gz
tor-c33722b5c0399a46e0029dfbce251c16afea35bc.zip
r18874@catbus: nickm | 2008-03-17 00:07:41 -0400
Backport: Only dump all guard node status to the log when the guard node status actually changes. Downgrade the 4 most common remaining INFO log messages to DEBUG. svn:r14071
-rw-r--r--ChangeLog5
-rw-r--r--src/or/circuitbuild.c26
-rw-r--r--src/or/connection.c4
-rw-r--r--src/or/directory.c4
4 files changed, 23 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index b626cee38f..0222da52f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,11 @@ Changes in version 0.2.0.22-rc - 2008-03-17
.in-addr.arpa addresses are passed to the DNSPort. Part of a fix
for bug 617. Bugfix on 0.2.0.1-alpha.
+ o Minor features:
+ - Only log guard node status when guard node status has changed.
+ - Downgrade the 3 most common "INFO" messages to "DEBUG". This will make
+ "INFO" 75% less verbose.
+
Changes in version 0.2.0.21-rc - 2008-03-02
o Major bugfixes:
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index aef1442aad..65b89e6ddc 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -755,8 +755,8 @@ circuit_extend(cell_t *cell, circuit_t *circ)
char tmpbuf[INET_NTOA_BUF_LEN];
in.s_addr = htonl(circ->n_addr);
tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf));
- log_info(LD_CIRC|LD_OR,"Next router (%s:%d) not connected. Connecting.",
- tmpbuf, circ->n_port);
+ log_debug(LD_CIRC|LD_OR,"Next router (%s:%d) not connected. Connecting.",
+ tmpbuf, circ->n_port);
circ->n_conn_onionskin = tor_malloc(ONIONSKIN_CHALLENGE_LEN);
memcpy(circ->n_conn_onionskin, onionskin, ONIONSKIN_CHALLENGE_LEN);
@@ -2169,7 +2169,7 @@ entry_guards_compute_status(void)
{
time_t now;
int changed = 0;
- int severity = LOG_INFO;
+ int severity = LOG_DEBUG;
or_options_t *options;
if (! entry_guards)
return;
@@ -2182,26 +2182,28 @@ entry_guards_compute_status(void)
{
routerinfo_t *r = router_get_by_digest(entry->identity);
const char *reason = NULL;
+ /*XXX021 log reason again. */
if (entry_guard_set_status(entry, r, now, options, &reason))
changed = 1;
if (entry->bad_since)
tor_assert(reason);
-
- log_info(LD_CIRC, "Summary: Entry '%s' is %s, %s%s, and %s.",
- entry->nickname,
- entry->unreachable_since ? "unreachable" : "reachable",
- entry->bad_since ? "unusable: " : "usable",
- entry->bad_since ? reason : "",
- entry_is_live(entry, 0, 1, 0) ? "live" : "not live");
});
if (remove_dead_entry_guards())
changed = 1;
+ severity = changed ? LOG_DEBUG : LOG_INFO;
+
if (changed) {
- log_fn(severity, LD_CIRC, " (%d/%d entry guards are usable/new)",
- num_live_entry_guards(), smartlist_len(entry_guards));
+ SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
+ log_info(LD_CIRC, "Summary: Entry '%s' is %s, %s, and %s.",
+ entry->nickname,
+ entry->unreachable_since ? "unreachable" : "reachable",
+ entry->bad_since ? "unusable: " : "usable",
+ entry_is_live(entry, 0, 1, 0) ? "live" : "not live"));
+ log_info(LD_CIRC, " (%d/%d entry guards are usable/new)",
+ num_live_entry_guards(), smartlist_len(entry_guards));
log_entry_guards(LOG_INFO);
entry_guards_changed();
}
diff --git a/src/or/connection.c b/src/or/connection.c
index 9e559530da..8168868644 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1965,14 +1965,14 @@ connection_read_to_buf(connection_t *conn, int *max_to_read)
switch (result) {
case TOR_TLS_CLOSE:
case TOR_TLS_ERROR_IO:
- log_info(LD_NET,"TLS connection closed %son read. Closing. "
+ log_debug(LD_NET,"TLS connection closed %son read. Closing. "
"(Nickname %s, address %s",
result == TOR_TLS_CLOSE ? "cleanly " : "",
or_conn->nickname ? or_conn->nickname : "not set",
conn->address);
return result;
CASE_TOR_TLS_ERROR_ANY_NONIO:
- log_info(LD_NET,"tls error [%s]. breaking (nickname %s, address %s).",
+ log_debug(LD_NET,"tls error [%s]. breaking (nickname %s, address %s).",
tor_tls_err_to_string(result),
or_conn->nickname ? or_conn->nickname : "not set",
conn->address);
diff --git a/src/or/directory.c b/src/or/directory.c
index ebcfc70b43..9b08f96e67 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2209,7 +2209,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
dlen = compressed ? d->dir_z_len : d->dir_len;
if (global_write_bucket_low(TO_CONN(conn), dlen, 1)) {
- log_info(LD_DIRSERV,
+ log_debug(LD_DIRSERV,
"Client asked for the mirrored directory, but we've been "
"writing too many bytes lately. Sending 503 Dir busy.");
write_http_status_line(conn, 503, "Directory busy, try again later");
@@ -2314,7 +2314,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
dlen = dirserv_estimate_data_size(dir_fps, 0, compressed);
if (global_write_bucket_low(TO_CONN(conn), dlen, 2)) {
- log_info(LD_DIRSERV,
+ log_debug(LD_DIRSERV,
"Client asked for network status lists, but we've been "
"writing too many bytes lately. Sending 503 Dir busy.");
write_http_status_line(conn, 503, "Directory busy, try again later");