Permalink
Browse files

More concise logging; debugging info

  • Loading branch information...
1 parent b6d6c57 commit 3dab8ea85347e7b7db8fa2d29ac406a4879e2f90 Martin Kleppmann committed Feb 28, 2009
Showing with 6 additions and 14 deletions.
  1. +1 −3 src/fc/util/log/StreamLogger.java
  2. +5 −11 src/fc/xml/diff/Diff.java
@@ -66,9 +66,7 @@ public void log(Object message, int level, Object data) {
}
if (isEnabled(level)) {
String name = (level >= 0 && level < names.length) ? names[level] : "UNKNOWN";
- out.println(name + ": " + format.format(new Date()));
- out.println(" - " + callingMethod());
- out.println(" - " + message);
+ out.println(name + " " + callingMethod() + ": " + message);
if (data != null) {
out.print(" - ");
if (data instanceof Throwable) {
View
@@ -114,6 +114,7 @@ public static boolean diff(ItemSource baseEs, XmlPullParser baseParser, ItemSour
List<Item> preamble = new ArrayList<Item>();
List<Item> base = IoUtil.makeEventList(baseEs, preamble, posListBase, baseParser);
List<Item> doc = IoUtil.makeEventList(docEs, null, posListNew, docParser);
+ Log.debug(base.toString());
GlMatcher<Item> m = new GlMatcher<Item>(IoUtil.getEventHashAlgorithm());
List<Segment<Item>> ml = m.match(base, doc, CHUNK_SIZES);
long _stop = System.currentTimeMillis();
@@ -134,7 +135,7 @@ public static boolean diff(ItemSource baseEs, XmlPullParser baseParser, ItemSour
(_stop - _start) + "ms).", LogLevels.INFO);
} else {
Log.log("Documents differ.", LogLevels.INFO);
- // Log.log("Match list is "+ml,Log.DEBUG);
+ Log.log("Match list is "+ml,Log.DEBUG);
}
return !isEmpty;
@@ -151,16 +152,9 @@ public static boolean diff(InputStream bases, InputStream docs, OutputStream dou
Log.log("Comparing by filter " + (filter == null ? "<none>" : filter.getName()),
LogLevels.INFO);
- return diff(IoUtil.getEventSequence(basepa, filter), null, // FIXME-20061113-3:
- // Passing
- // of
- // XmlPull
- // parser
- // basepa,
- IoUtil.getEventSequence(docpa, filter), null, // FIXME-20061113-3:
- // Passing of
- // XmlPull
- // parser docpa,
+ // FIXME-20061113-3: Passing of XmlPullParser
+ return diff(IoUtil.getEventSequence(basepa, filter), null,
+ IoUtil.getEventSequence(docpa, filter), null,
dout, outputEncoding, encoderOptions, emitEmpty);
}

0 comments on commit 3dab8ea

Please sign in to comment.