logging: log versions

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1292619 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2012-02-23 02:00:10 +00:00
parent a9fbb020a5
commit 42c1ca8212
1 changed files with 11 additions and 2 deletions

View File

@ -106,7 +106,10 @@ class LogUpdateProcessor extends UpdateRequestProcessor {
}
if (adds.size() < maxNumToLog) {
adds.add(cmd.getPrintableId());
long version = cmd.getVersion();
String msg = cmd.getPrintableId();
if (version != 0) msg = msg + " (" + version + ')';
adds.add(msg);
}
if (logDebug) { log.debug("add {}", cmd.getPrintableId()); }
@ -123,11 +126,17 @@ class LogUpdateProcessor extends UpdateRequestProcessor {
toLog.add("delete",deletes);
}
if (deletes.size() < maxNumToLog) {
deletes.add(cmd.getId());
long version = cmd.getVersion();
String msg = cmd.getId();
if (version != 0) msg = msg + " (" + version + ')';
deletes.add(msg);
}
if (logDebug) { log.debug("delete {}", cmd.getId()); }
} else {
if (toLog.size() < maxNumToLog) {
long version = cmd.getVersion();
String msg = cmd.query;
if (version != 0) msg = msg + " (" + version + ')';
toLog.add("deleteByQuery", cmd.query);
}
if (logDebug) { log.debug("deleteByQuery {}", cmd.getQuery()); }