Skip to content

Commit

Permalink
don't log path in EvalRaw
Browse files Browse the repository at this point in the history
eval nodes no longer always have a context path
  • Loading branch information
jbardin committed Mar 25, 2020
1 parent 04a117b commit 5810261
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions terraform/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,16 @@ func Eval(n EvalNode, ctx EvalContext) (interface{}, error) {
// EvalRaw is like Eval except that it returns all errors, even if they
// signal something normal such as EvalEarlyExitError.
func EvalRaw(n EvalNode, ctx EvalContext) (interface{}, error) {
path := "unknown"

// FIXME: restore the path here somehow or log this in another manner
// We cannot call Path here, since the context may not yet have the path
// set.
//if ctx != nil {
// path = ctx.Path().String()
//}
//if path == "" {
// path = "<root>"
//}

log.Printf("[TRACE] %s: eval: %T", path, n)
log.Printf("[TRACE] eval: %T", n)
output, err := n.Eval(ctx)
if err != nil {
switch err.(type) {
case EvalEarlyExitError:
log.Printf("[TRACE] %s: eval: %T, early exit err: %s", path, n, err)
log.Printf("[TRACE] eval: %T, early exit err: %s", n, err)
case tfdiags.NonFatalError:
log.Printf("[WARN] %s: eval: %T, non-fatal err: %s", path, n, err)
log.Printf("[WARN] eval: %T, non-fatal err: %s", n, err)
default:
log.Printf("[ERROR] %s: eval: %T, err: %s", path, n, err)
log.Printf("[ERROR] eval: %T, err: %s", n, err)
}
}

Expand Down

0 comments on commit 5810261

Please sign in to comment.