don't log path in EvalRaw
eval nodes no longer always have a context path
This commit is contained in:
parent
04a117b2a1
commit
5810261add
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue