quiet excessive logging

This commit is contained in:
gojomo
2009-06-05 02:00:07 +00:00
parent 92f5ca2a45
commit d336ea760f
5 changed files with 29 additions and 22 deletions
@@ -227,7 +227,7 @@ public abstract class WriterPoolMember implements ArchiveFileConstants {
this.f = file;
this.fos = new FileOutputStream(this.f);
this.out = new FastBufferedOutputStream(this.fos);
logger.info("Opened " + this.f.getAbsolutePath());
logger.fine("Opened " + this.f.getAbsolutePath());
return this.f.getName();
}
@@ -492,7 +492,7 @@ public abstract class WriterPoolMember implements ArchiveFileConstants {
this.f = f;
}
logger.info("Closed " + this.f.getAbsolutePath() +
logger.fine("Closed " + this.f.getAbsolutePath() +
", size " + this.f.length());
}
}
@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.logging.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
@@ -53,6 +54,9 @@ import org.springframework.validation.Validator;
* @contributor gojomo
*/
public class PathSharingContext extends FileSystemXmlApplicationContext {
private static Logger LOGGER =
Logger.getLogger(PathSharingContext.class.getName());
public PathSharingContext(String configLocation) throws BeansException {
super(configLocation);
@@ -204,13 +208,11 @@ public class PathSharingContext extends FileSystemXmlApplicationContext {
allErrors.put(name,errors);
}
}
System.err.println("===errors===");
for(String name : allErrors.keySet()) {
for(Object obj : allErrors.get(name).getAllErrors()) {
System.err.println(name+": "+obj);
LOGGER.fine("validation error for '"+name+"': "+obj);
}
}
System.err.println("============");
}
public HashMap<String,Errors> getAllErrors() {
@@ -186,8 +186,8 @@ public class ReplayCharSequenceTest extends TmpDirTestCase
bytes, 1, "testSingleByteEncodings-latin1.txt", 0);
ReplayCharSequence rcs = ros.getReplayCharSequence("latin1");
String result = rcs.toString();
logger.info("latin1[0] " + toHexString(latin1String));
logger.info("latin1[1] " + toHexString(result));
logger.fine("latin1[0] " + toHexString(latin1String));
logger.fine("latin1[1] " + toHexString(result));
assertEquals("latin1 strings don't match", result, latin1String);
String w1252String = new String(bytes, "windows-1252");
@@ -195,8 +195,8 @@ public class ReplayCharSequenceTest extends TmpDirTestCase
bytes, 1, "testSingleByteEncodings-windows-1252.txt", 0);
rcs = ros.getReplayCharSequence("windows-1252");
result = rcs.toString();
logger.info("windows-1252[0] " + toHexString(w1252String));
logger.info("windows-1252[1] " + toHexString(result));
logger.fine("windows-1252[0] " + toHexString(w1252String));
logger.fine("windows-1252[1] " + toHexString(result));
assertEquals("windows-1252 strings don't match", result, w1252String);
String asciiString = new String(bytes, "ascii");
@@ -204,8 +204,8 @@ public class ReplayCharSequenceTest extends TmpDirTestCase
bytes, 1, "testSingleByteEncodings-ascii.txt", 0);
rcs = ros.getReplayCharSequence("ascii");
result = rcs.toString();
logger.info("ascii[0] " + toHexString(asciiString));
logger.info("ascii[1] " + toHexString(result));
logger.fine("ascii[0] " + toHexString(asciiString));
logger.fine("ascii[1] " + toHexString(result));
assertEquals("ascii strings don't match", result, asciiString);
}
@@ -23,10 +23,13 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Map;
import java.util.logging.Logger;
import junit.framework.TestCase;
public class ANVLRecordTest extends TestCase {
private final Logger logger = Logger.getLogger(this.getClass().getName());
public void testAdd() throws Exception {
ANVLRecord am = new ANVLRecord();
am.add(new Element(new Label("entry")));
@@ -42,9 +45,9 @@ public class ANVLRecordTest extends TestCase {
new Value("The Yeoman of \r the guard")));
am.add(new Element(new Label("when/created"),
new Value("1888")));
System.out.println(am.toString());
logger.fine(am.toString());
Map<String,String> m = am.asMap();
System.out.println(m.toString());
logger.fine(m.toString());
}
public void testEmptyRecord() throws Exception {
@@ -71,16 +74,16 @@ public class ANVLRecordTest extends TestCase {
"\r\nx:\r\n # z\r\n\r\n";
ANVLRecord r = ANVLRecord.load(new ByteArrayInputStream(
record.getBytes("ISO-8859-1")));
System.out.println(r);
logger.fine(r.toString());
assertEquals(r.get(0).toString(), "a: b");
record = " a: b\r\n\r\nsdfsdsdfds";
r = ANVLRecord.load(new ByteArrayInputStream(
record.getBytes("ISO-8859-1")));
System.out.println(r);
logger.fine(r.toString());
record = "x:\r\n # z\r\ny:\r\n\r\n";
r = ANVLRecord.load(new ByteArrayInputStream(
record.getBytes("ISO-8859-1")));
System.out.println(r);
logger.fine(r.toString());
assertEquals(r.get(0).toString(), "x:");
}
@@ -93,7 +96,7 @@ public class ANVLRecordTest extends TestCase {
"when/created:\t 1888\r\n\r\n";
ANVLRecord r = ANVLRecord.load(new ByteArrayInputStream(
sample.getBytes("ISO-8859-1")));
System.out.println(r);
logger.fine(r.toString());
}
public void testPoundLabel()
@@ -104,7 +107,7 @@ public class ANVLRecordTest extends TestCase {
"\t\tthe Guard\r\n" +
"when/created:\t 1888\r\n\r\n";
ANVLRecord r = ANVLRecord.load(sample);
System.out.println(r);
logger.fine(r.toString());
}
public void testNewlineLabel()
@@ -32,6 +32,7 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.util.logging.Logger;
import org.apache.poi.hdf.extractor.WordDocument;
@@ -39,6 +40,7 @@ import junit.framework.TestCase;
public class DocTest extends TestCase {
private final Logger logger = Logger.getLogger(this.getClass().getName());
final private static File TEST_DIR;
@@ -63,7 +65,7 @@ public class DocTest extends TestCase {
}
} finally {
long duration = System.currentTimeMillis() - start;
System.out.println("Duration in milliseconds: " + duration);
logger.fine("Duration in milliseconds: " + duration);
}
}
if (errors > 0) {
@@ -73,7 +75,7 @@ public class DocTest extends TestCase {
private int runDoc(File doc) throws IOException {
System.out.println("===== Now processing " + doc.getName());
logger.fine("===== Now processing " + doc.getName());
String name = doc.getName();
int p = name.lastIndexOf('.');
String expectedName = name.substring(0, p) + ".txt";
@@ -136,7 +138,7 @@ public class DocTest extends TestCase {
go = false;
if ((ch >= 0) || (expectedCh >= 0)) {
errors++;
System.out.println("File lengths differ.");
logger.fine("File lengths differ.");
}
}
if (ch != expectedCh) {
@@ -155,7 +157,7 @@ public class DocTest extends TestCase {
msg.append(expected).append(" (").append(toChar(expected));
msg.append(") but got ").append(actual).append(" (");
msg.append(toChar(actual)).append(").");
System.out.println(msg);
logger.fine(msg.toString());
}