[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [ernie/master] Make logs somewhat more readable.
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Wed, 14 Apr 2010 12:56:56 +0200
Subject: Make logs somewhat more readable.
Commit: 83d2c0d115666fb1d3b86b12a8fb227a7079d24a
---
src/ArchiveReader.java | 2 +-
src/ArchiveWriter.java | 17 ++++++-------
src/CachedRelayDescriptorReader.java | 2 +-
src/LoggingConfiguration.java | 4 +-
src/RelayDescriptorDownloader.java | 44 +++++++++++++++++-----------------
5 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/src/ArchiveReader.java b/src/ArchiveReader.java
index ef68cc1..10326da 100644
--- a/src/ArchiveReader.java
+++ b/src/ArchiveReader.java
@@ -115,7 +115,7 @@ public class ArchiveReader {
}
}
logger.info("Finished importing relay descriptors from local "
- + "directory:\nParsed " + parsedFiles + " and ignored "
+ + "directory:\nParsed " + parsedFiles + ", ignored "
+ ignoredFiles + " files.");
}
}
diff --git a/src/ArchiveWriter.java b/src/ArchiveWriter.java
index 051431f..cced896 100644
--- a/src/ArchiveWriter.java
+++ b/src/ArchiveWriter.java
@@ -93,10 +93,10 @@ public class ArchiveWriter {
public void dumpStats() {
StringBuilder sb = new StringBuilder("Finished writing relay "
+ "descriptors to disk:\nIn this execution, we stored "
- + this.storedConsensuses + " consensuses, " + this.storedVotes
- + " votes, " + this.storedServerDescriptors
- + " server descriptors, and " + this.storedExtraInfoDescriptors
- + " extra-info descriptors to disk.\n");
+ + this.storedConsensuses + " consensus(es), " + this.storedVotes
+ + " vote(s), " + this.storedServerDescriptors
+ + " server descriptor(s), and " + this.storedExtraInfoDescriptors
+ + " extra-info descriptor(s) to disk.\n");
sb.append("Statistics on the completeness of written relay "
+ "descriptors of the past 12 consensuses (Consensus/Vote, "
+ "valid-after, votes, server descriptors, extra-infos):");
@@ -211,9 +211,8 @@ public class ArchiveWriter {
}
}
vbr.close();
- sb.append(String.format("%nV %s "
- + " %d/%d (%5.1f%%) %d/%d (%5.1f%%)",
- validAfterTime,
+ sb.append(String.format("%nV, %s, NA, %d/%d (%5.1f%%), "
+ + "%d/%d (%5.1f%%)", validAfterTime,
voteFoundServerDescs, voteAllServerDescs,
100.0D * (double) voteFoundServerDescs /
(double) voteAllServerDescs,
@@ -257,8 +256,8 @@ public class ArchiveWriter {
}
}
}
- sb.append(String.format("%nC %s %d/%d (%5.1f%%) %d/%d (%5.1f%%) "
- + "%d/%d (%5.1f%%)",
+ sb.append(String.format("%nC, %s, %d/%d (%5.1f%%), "
+ + "%d/%d (%5.1f%%), %d/%d (%5.1f%%)",
validAfterTime, foundVotes, allVotes,
100.0D * (double) foundVotes / (double) allVotes,
foundServerDescs, allServerDescs,
diff --git a/src/CachedRelayDescriptorReader.java b/src/CachedRelayDescriptorReader.java
index cb5ca28..12bb334 100644
--- a/src/CachedRelayDescriptorReader.java
+++ b/src/CachedRelayDescriptorReader.java
@@ -100,7 +100,7 @@ public class CachedRelayDescriptorReader {
parsedNum++;
}
}
- dumpStats.append("\n" + f.getName() + ": " + parsedNum
+ dumpStats.append("\n" + f.getName() + ": " + parsedNum + " "
+ (f.getName().startsWith("cached-descriptors") ?
"server" : "extra-info") + " descriptors");
logger.fine("Finished reading "
diff --git a/src/LoggingConfiguration.java b/src/LoggingConfiguration.java
index e4758e9..74f628b 100644
--- a/src/LoggingConfiguration.java
+++ b/src/LoggingConfiguration.java
@@ -134,7 +134,7 @@ public class LoggingConfiguration {
+ "operator to look after the otherwise unattended "
+ "setup.</i></p>\n"
+ " <br/>\n"
- + " <table border=\"0\" cellpadding=\"0\" "
+ + " <table border=\"0\" cellpadding=\"4\" "
+ "cellspacing=\"0\" summary=\"\">\n"
+ " <colgroup>\n"
+ " <col width=\"160\">\n"
@@ -154,7 +154,7 @@ public class LoggingConfiguration {
+ "operator in making sure that operation works as "
+ "expected.</i></p>\n"
+ " <br/>\n"
- + " <table border=\"0\" cellpadding=\"0\" "
+ + " <table border=\"0\" cellpadding=\"4\" "
+ "cellspacing=\"0\" summary=\"\">\n"
+ " <colgroup>\n"
+ " <col width=\"160\">\n"
diff --git a/src/RelayDescriptorDownloader.java b/src/RelayDescriptorDownloader.java
index e67def2..0c03532 100644
--- a/src/RelayDescriptorDownloader.java
+++ b/src/RelayDescriptorDownloader.java
@@ -201,10 +201,10 @@ public class RelayDescriptorDownloader {
dumpStats = new StringBuilder();
dumpStats.append("Finished downloading relay descriptors from the "
+ "directory authorities:\nAt the beginning of this execution, "
- + "we were missing " + missingConsensuses + " consensuses, "
- + missingVotes + " votes, " + missingServerDescriptors
- + " server descriptors, and " + missingExtraInfoDescriptors
- + " extra-info descriptors.");
+ + "we were missing " + missingConsensuses + " consensus(es), "
+ + missingVotes + " vote(s), " + missingServerDescriptors
+ + " server descriptor(s), and " + missingExtraInfoDescriptors
+ + " extra-info descriptor(s).\n");
}
}
@@ -514,27 +514,27 @@ public class RelayDescriptorDownloader {
}
dumpStats.append("During this execution, we added "
- + this.newMissingConsensuses + " consensuses, "
- + this.newMissingVotes + " votes, "
- + this.newMissingServerDescriptors + " server descriptors, and "
- + this.newMissingExtraInfoDescriptors + " extra-info descriptors "
- + "to the missing list.\n");
+ + this.newMissingConsensuses + " consensus(es), "
+ + this.newMissingVotes + " vote(s), "
+ + this.newMissingServerDescriptors + " server descriptor(s), and "
+ + this.newMissingExtraInfoDescriptors + " extra-info "
+ + "descriptor(s) to the missing list.\n");
dumpStats.append("We attempted to download " + this.triedConsensuses
- + " consensuses, " + this.triedVotes + " votes, "
- + this.triedServerDescriptors + " server descriptors, and "
- + this.triedExtraInfoDescriptors + " extra-info descriptors from "
- + "the directory authorities.\n");
- dumpStats.append("We successfully downloaded "
- + this.downloadedConsensuses + " consensuses, "
- + this.downloadedVotes + " votes, "
- + this.downloadedServerDescriptors + " server descriptors, and "
- + this.downloadedExtraInfoDescriptors + " extra-info descriptors "
+ + " consensus(es), " + this.triedVotes + " vote(s), "
+ + this.triedServerDescriptors + " server descriptor(s), and "
+ + this.triedExtraInfoDescriptors + " extra-info descriptor(s) "
+ "from the directory authorities.\n");
+ dumpStats.append("We successfully downloaded "
+ + this.downloadedConsensuses + " consensus(es), "
+ + this.downloadedVotes + " vote(s), "
+ + this.downloadedServerDescriptors + " server descriptor(s), and "
+ + this.downloadedExtraInfoDescriptors + " extra-info "
+ + "descriptor(s) from the directory authorities.\n");
dumpStats.append("At the end of this execution, "
- + "we are missing " + missingConsensuses + " consensuses, "
- + missingVotes + " votes, " + missingServerDescriptors
- + " server descriptors, and " + missingExtraInfoDescriptors
- + " extra-info descriptors, some of which we may try in the next "
+ + "we are missing " + missingConsensuses + " consensus(es), "
+ + missingVotes + " vote(s), " + missingServerDescriptors
+ + " server descriptor(s), and " + missingExtraInfoDescriptors
+ + " extra-info descriptor(s), some of which we may try in the next "
+ "execution.");
this.logger.info(dumpStats.toString());
}
--
1.6.5