Skip to content

Commit

Permalink
More concise logging; debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kleppmann committed Feb 28, 2009
1 parent b6d6c57 commit 3dab8ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
4 changes: 1 addition & 3 deletions src/fc/util/log/StreamLogger.java
Expand Up @@ -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) {
Expand Down
16 changes: 5 additions & 11 deletions src/fc/xml/diff/Diff.java
Expand Up @@ -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();
Expand All @@ -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;
Expand All @@ -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);
}

Expand Down

0 comments on commit 3dab8ea

Please sign in to comment.