[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [ernie/master] Better fix for logs.
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Wed, 14 Apr 2010 13:55:42 +0200
Subject: Better fix for logs.
Commit: eb733d8c490ce75e1bd3cfdd26adf594f6e5e580
---
src/ArchiveWriter.java | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/ArchiveWriter.java b/src/ArchiveWriter.java
index d632924..9c96d42 100644
--- a/src/ArchiveWriter.java
+++ b/src/ArchiveWriter.java
@@ -129,7 +129,8 @@ public class ArchiveWriter {
}
for (File f : consensuses) {
BufferedReader br = new BufferedReader(new FileReader(f));
- String line = null, validAfterTime = null, voteFilename = null;
+ String line = null, validAfterTime = null,
+ voteFilenamePrefix = null, dirSource = null;
int allVotes = 0, foundVotes = 0,
allServerDescs = 0, foundServerDescs = 0,
allExtraInfos = 0, foundExtraInfos = 0;
@@ -138,15 +139,15 @@ public class ArchiveWriter {
validAfterTime = line.substring("valid-after ".length());
long validAfter = validAfterFormat.parse(
validAfterTime).getTime();
- voteFilename = outputDirectory + "/vote/"
+ voteFilenamePrefix = outputDirectory + "/vote/"
+ consensusVoteFormat.format(new Date(validAfter))
+ "-vote-";
} else if (line.startsWith("dir-source ")) {
- voteFilename += line.split(" ")[2] + "-";
+ dirSource = line.split(" ")[2];
} else if (line.startsWith("vote-digest ")) {
- voteFilename += line.split(" ")[1];
allVotes++;
- File voteFile = new File(voteFilename);
+ File voteFile = new File(voteFilenamePrefix + dirSource + "-"
+ + line.split(" ")[1]);
if (voteFile.exists()) {
foundVotes++;
BufferedReader vbr = new BufferedReader(new FileReader(
--
1.6.5