|
21 | 21 | public abstract class RuleExecutor<TreeType extends Node<TreeType>> {
|
22 | 22 |
|
23 | 23 | private final Logger log = LogManager.getLogger(getClass());
|
| 24 | + /** |
| 25 | + * Sub-logger intended to show only changes made by the rules. Intended for debugging. |
| 26 | + * |
| 27 | + * Enable it like this for the respective optimizers and the analyzer, resp. all inheritors of this class: |
| 28 | + * <pre>{@code |
| 29 | + * PUT localhost:9200/_cluster/settings |
| 30 | + * |
| 31 | + * { |
| 32 | + * "transient" : { |
| 33 | + * "logger.org.elasticsearch.xpack.esql.analysis.Analyzer.changes": "TRACE", |
| 34 | + * "logger.org.elasticsearch.xpack.esql.optimizer.LogicalPlanOptimizer.changes": "TRACE", |
| 35 | + * "logger.org.elasticsearch.xpack.esql.optimizer.LocalLogicalPlanOptimizer.changes": "TRACE", |
| 36 | + * "logger.org.elasticsearch.xpack.esql.optimizer.PhysicalPlanOptimizer.changes": "TRACE", |
| 37 | + * "logger.org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer.changes": "TRACE" |
| 38 | + * } |
| 39 | + * } |
| 40 | + * }</pre> |
| 41 | + */ |
| 42 | + private final Logger changeLog = LogManager.getLogger(getClass().getName() + ".changes"); |
24 | 43 |
|
25 | 44 | public static class Limiter {
|
26 | 45 | public static final Limiter DEFAULT = new Limiter(100);
|
@@ -174,8 +193,8 @@ protected final ExecutionInfo executeWithInfo(TreeType plan) {
|
174 | 193 |
|
175 | 194 | if (tf.hasChanged()) {
|
176 | 195 | hasChanged = true;
|
177 |
| - if (log.isTraceEnabled()) { |
178 |
| - log.trace("Rule {} applied with change\n{}", rule, NodeUtils.diffString(tf.before, tf.after)); |
| 196 | + if (changeLog.isTraceEnabled()) { |
| 197 | + changeLog.trace("Rule {} applied with change\n{}", rule, NodeUtils.diffString(tf.before, tf.after)); |
179 | 198 | }
|
180 | 199 | } else {
|
181 | 200 | if (log.isTraceEnabled()) {
|
|
0 commit comments