Also dump visitor session trace on failure, not just on success
@@ -308,13 +308,14 @@ class VdsVisitor extends VisitorDataHandler implements Visitor {
}
} finally {
session.destroy();
- }
- query.trace(session.getTrace().toString(), false, 9);
if (log.isLoggable(LogLevel.DEBUG)) {
- log.log(LogLevel.DEBUG, session.getTrace().toString());
+ log.log(LogLevel.DEBUG, () -> session.getTrace().toString());
+ }
}
+ query.trace(session.getTrace().toString(), false, 9);
+
if (params.getControlHandler().getResult().code == VisitorControlHandler.CompletionCode.SUCCESS) {
if (log.isLoggable(LogLevel.DEBUG)) {
log.log(LogLevel.DEBUG, "VdsVisitor completed successfully for " + query + " with selection " + params.getDocumentSelection());
