Skip to content

Commit dd7be66

Browse files
committed
simplify logging description
1 parent 307a60c commit dd7be66

File tree

1 file changed

+6
-11
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session

1 file changed

+6
-11
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlSession.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public void analyzedPlan(
441441
l.onFailure(e);
442442
return;
443443
}
444-
LOGGER.debug("Analyzed plan (second attempt, without filter):\n{}", plan);
444+
LOGGER.debug("Analyzed plan (second attempt without filter):\n{}", plan);
445445
l.onResponse(plan);
446446
}).addListener(logicalPlanListener);
447447
}
@@ -744,9 +744,9 @@ private static void analyzeAndMaybeRetry(
744744
ActionListener<PreAnalysisResult> l
745745
) {
746746
LogicalPlan plan = null;
747-
var filterPresentMessage = requestFilter == null ? "without" : "with";
748-
var attemptMessage = requestFilter == null ? "the only" : "first";
749-
LOGGER.debug("Analyzing the plan ({} attempt, {} filter)", attemptMessage, filterPresentMessage);
747+
748+
var description = requestFilter == null ? "the only attempt without filter" : "first attempt with filter";
749+
LOGGER.debug("Analyzing the plan ({})", description);
750750

751751
try {
752752
if (result.indices.isValid() || requestFilter != null) {
@@ -756,12 +756,7 @@ private static void analyzeAndMaybeRetry(
756756
}
757757
plan = analyzeAction.apply(result);
758758
} catch (VerificationException ve) {
759-
LOGGER.debug(
760-
"Analyzing the plan ({} attempt, {} filter) failed with {}",
761-
attemptMessage,
762-
filterPresentMessage,
763-
ve.getDetailedMessage()
764-
);
759+
LOGGER.debug("Analyzing the plan ({}) failed with {}", description, ve.getDetailedMessage());
765760
if (requestFilter == null) {
766761
// if the initial request didn't have a filter, then just pass the exception back to the user
767762
logicalPlanListener.onFailure(ve);
@@ -775,7 +770,7 @@ private static void analyzeAndMaybeRetry(
775770
logicalPlanListener.onFailure(e);
776771
return;
777772
}
778-
LOGGER.debug("Analyzed plan ({} attempt, {} filter):\n{}", attemptMessage, filterPresentMessage, plan);
773+
LOGGER.debug("Analyzed plan ({}):\n{}", description, plan);
779774
// the analysis succeeded from the first attempt, irrespective if it had a filter or not, just continue with the planning
780775
logicalPlanListener.onResponse(plan);
781776
}

0 commit comments

Comments
 (0)