don't log path in EvalRaw

eval nodes no longer always have a context path
This commit is contained in:
James Bardin 2020-03-25 15:39:51 -04:00
parent 04a117b2a1
commit 5810261add
1 changed files with 4 additions and 16 deletions

View File

@ -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)
}
}