diff --git a/internal/runner/exec/exec.go b/internal/runner/exec/exec.go index 877af7e..bdd065c 100644 --- a/internal/runner/exec/exec.go +++ b/internal/runner/exec/exec.go @@ -1,7 +1,6 @@ package exec import ( - "github.com/jahvon/tuikit/io" "github.com/pkg/errors" "github.com/jahvon/flow/internal/context" @@ -53,10 +52,7 @@ func (r *execRunner) Exec(ctx *context.Context, e *executable.Executable, inputE } logMode := execSpec.LogMode - var logFields map[string]interface{} - if logMode == io.JSON || logMode == io.Logfmt { - logFields = execSpec.GetLogFields() - } + logFields := execSpec.GetLogFields() switch { case execSpec.Cmd == "" && execSpec.File == "": diff --git a/internal/runner/parallel/parallel.go b/internal/runner/parallel/parallel.go index c605e43..6bff8bb 100644 --- a/internal/runner/parallel/parallel.go +++ b/internal/runner/parallel/parallel.go @@ -72,12 +72,10 @@ func handleExecRef( return err } - if exec.Exec != nil { - fields := map[string]interface{}{ - "e": exec.ID(), - } - exec.Exec.SetLogFields(fields) + fields := map[string]interface{}{ + "step": exec.ID(), } + exec.Exec.SetLogFields(fields) group.Go(func() error { if parallelSpec.FailFast { @@ -142,12 +140,10 @@ func handleExec( maps.Copy(execPromptedEnv, a) } - if exec.Exec != nil { - fields := map[string]interface{}{ - "e": exec.ID(), - } - exec.Exec.SetLogFields(fields) + fields := map[string]interface{}{ + "step": exec.ID(), } + exec.Exec.SetLogFields(fields) group.Go(func() error { var attempts int diff --git a/internal/runner/serial/serial.go b/internal/runner/serial/serial.go index febaa84..e986fa3 100644 --- a/internal/runner/serial/serial.go +++ b/internal/runner/serial/serial.go @@ -68,12 +68,10 @@ func handleExecRef( return fmt.Errorf("unable to find e with reference %s", executableRef) } - if exec.Exec != nil { - fields := map[string]interface{}{ - "e": exec.ID(), - } - exec.Exec.SetLogFields(fields) + fields := map[string]interface{}{ + "step": exec.ID(), } + exec.Exec.SetLogFields(fields) if err := runner.Exec(ctx, exec, promptedEnv); err != nil { if serialSpec.FailFast { @@ -121,6 +119,11 @@ func handleExec( maps.Copy(execPromptedEnv, a) } + fields := map[string]interface{}{ + "step": exec.ID(), + } + exec.Exec.SetLogFields(fields) + var attempts int retryLoop: for {