package bootstrap

type LogAction struct {
	ID     string `json:"id"`
	Output string `json:"output"`
}

type LogMessage struct {
	Msg string `json:"message"`
}

func (l *LogMessage) String() string {
	return l.Msg
}

func init() {
	Register("log", &LogAction{})
}

func (a *LogAction) Run(s *State) error {
	s.StepData[a.ID] = &LogMessage{Msg: interpolate(s, a.Output)}
	return nil
}

package bootstrap

import (
	"fmt"
)

type LogAction struct {
	Output string `json:"output"`
}

func init() {
	Register("log", &LogAction{})
}

func (a *LogAction) Run(s *State) error {
	fmt.Println(interpolate(s, a.Output))
	return nil
}

--- 
+++ 
@@ -1,11 +1,16 @@
 package bootstrap
 
-import (
-	"fmt"
-)
+type LogAction struct {
+	ID     string `json:"id"`
+	Output string `json:"output"`
+}
 
-type LogAction struct {
-	Output string `json:"output"`
+type LogMessage struct {
+	Msg string `json:"message"`
+}
+
+func (l *LogMessage) String() string {
+	return l.Msg
 }
 
 func init() {
@@ -13,6 +18,6 @@
 }
 
 func (a *LogAction) Run(s *State) error {
-	fmt.Println(interpolate(s, a.Output))
+	s.StepData[a.ID] = &LogMessage{Msg: interpolate(s, a.Output)}
 	return nil
 }
bootstrap: Modify log action so JSON output is consistent

Without this, the output stream includes non-JSON text when running with
--json=true

Signed-off-by: Lewis Marshall <748e1641a368164906d4a0c0e3965345453dcc93@lmars.net>
