mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Only call StringWithNodeTypes for TRACE logs (#1810)
Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
This commit is contained in:
parent
eb69100dbd
commit
7d94797219
@ -6,6 +6,7 @@ NEW FEATURES:
|
||||
|
||||
ENHANCEMENTS:
|
||||
* Added `-show-sensitive` flag to tofu plan, apply, state-show and output commands to display sensitive data in output. ([#1554](https://github.com/opentofu/opentofu/pull/1554))
|
||||
* Improved performance for large graphs when debug logs are not enabled. ([#1810](https://github.com/opentofu/opentofu/pull/1810))
|
||||
|
||||
BUG FIXES:
|
||||
* Ensure that using a sensitive path for templatefile that it doesn't panic([#1801](https://github.com/opentofu/opentofu/issues/1801))
|
||||
|
@ -43,11 +43,14 @@ func (b *BasicGraphBuilder) Build(path addrs.ModuleInstance) (*Graph, tfdiags.Di
|
||||
log.Printf("[TRACE] Executing graph transform %T", step)
|
||||
|
||||
err := step.Transform(g)
|
||||
if thisStepStr := g.StringWithNodeTypes(); thisStepStr != lastStepStr {
|
||||
log.Printf("[TRACE] Completed graph transform %T with new graph:\n%s ------", step, logging.Indent(thisStepStr))
|
||||
lastStepStr = thisStepStr
|
||||
} else {
|
||||
log.Printf("[TRACE] Completed graph transform %T (no changes)", step)
|
||||
|
||||
if logging.IsDebugOrHigher() {
|
||||
if thisStepStr := g.StringWithNodeTypes(); thisStepStr != lastStepStr {
|
||||
log.Printf("[TRACE] Completed graph transform %T with new graph:\n%s ------", step, logging.Indent(thisStepStr))
|
||||
lastStepStr = thisStepStr
|
||||
} else {
|
||||
log.Printf("[TRACE] Completed graph transform %T (no changes)", step)
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
@ -39,11 +39,14 @@ func (t *graphTransformerMulti) Transform(g *Graph) error {
|
||||
if err := t.Transform(g); err != nil {
|
||||
return err
|
||||
}
|
||||
if thisStepStr := g.StringWithNodeTypes(); thisStepStr != lastStepStr {
|
||||
log.Printf("[TRACE] (graphTransformerMulti) Completed graph transform %T with new graph:\n%s ------", t, logging.Indent(thisStepStr))
|
||||
lastStepStr = thisStepStr
|
||||
} else {
|
||||
log.Printf("[TRACE] (graphTransformerMulti) Completed graph transform %T (no changes)", t)
|
||||
|
||||
if logging.IsDebugOrHigher() {
|
||||
if thisStepStr := g.StringWithNodeTypes(); thisStepStr != lastStepStr {
|
||||
log.Printf("[TRACE] (graphTransformerMulti) Completed graph transform %T with new graph:\n%s ------", t, logging.Indent(thisStepStr))
|
||||
lastStepStr = thisStepStr
|
||||
} else {
|
||||
log.Printf("[TRACE] (graphTransformerMulti) Completed graph transform %T (no changes)", t)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user