From f4de9d185afc13cf377f29e2353a8f1ea87daf04 Mon Sep 17 00:00:00 2001 From: jeyrs Date: Wed, 4 Oct 2017 15:16:03 -0700 Subject: [PATCH] chore(expressions): Cleanup some noisy logs - Include execution id in log message - Remove some noise with debug statements --- .../pipeline/expressions/ExpressionEvaluationSummary.java | 2 +- .../orca/pipeline/expressions/ExpressionTransform.groovy | 1 - .../orca/pipeline/util/ContextParameterProcessor.groovy | 5 ++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionEvaluationSummary.java b/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionEvaluationSummary.java index a011fa5a30..88797eb750 100644 --- a/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionEvaluationSummary.java +++ b/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionEvaluationSummary.java @@ -69,7 +69,7 @@ public void appendAttempted(String expression) { public String toString() { String attempted = attempts.stream().collect(Collectors.joining(",")); String failed = expressionResult.keySet().stream().collect(Collectors.joining(",")); - return String.format("Evaluated %d expression(s) - (%s), %d failed - (%s)", + return String.format("%d expression(s) - (%s), %d failed - (%s)", getTotalEvaluated(), attempted, getFailureCount(), diff --git a/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionTransform.groovy b/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionTransform.groovy index ce6fb8cefb..f8e88be356 100644 --- a/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionTransform.groovy +++ b/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionTransform.groovy @@ -61,7 +61,6 @@ class ExpressionTransform { } as T } else if ((source instanceof String || source instanceof GString) && source.toString().contains(parserContext.getExpressionPrefix())) { String literalExpression = source.toString() - log.debug("Processing expression {}", literalExpression) literalExpression = includeExecutionObjectForStageFunctions(literalExpression) T result diff --git a/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/util/ContextParameterProcessor.groovy b/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/util/ContextParameterProcessor.groovy index 1116da264b..51887d8fb3 100644 --- a/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/util/ContextParameterProcessor.groovy +++ b/orca-core/src/main/groovy/com/netflix/spinnaker/orca/pipeline/util/ContextParameterProcessor.groovy @@ -90,8 +90,8 @@ class ContextParameterProcessor { allowUnknownKeys, ) - if (summary.totalEvaluated > 0) { - log.debug(summary.toString()) + if (summary.totalEvaluated > 0 && context.execution) { + log.info("Evaluated {} in execution {}", summary, context.execution.id) } if (summary.failureCount > 0) { @@ -103,7 +103,6 @@ class ContextParameterProcessor { Map process(Map parameters, Map context, boolean allowUnknownKeys) { if (PipelineExpressionEvaluator.shouldUseV2Evaluator(parameters) || PipelineExpressionEvaluator.shouldUseV2Evaluator(context)) { - log.debug("Using V2 expression evaluation") return processV2(parameters, context, allowUnknownKeys) }