Skip to content

Commit

Permalink
feat: add pre/post stage identifier fields to json log output
Browse files Browse the repository at this point in the history
Co-authored-by: Markus Wolf <markus.wolf@new-work.se>
  • Loading branch information
2 people authored and github-actions committed May 23, 2022
1 parent 8b93de2 commit eaea781
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/runner/job_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/nektos/act/pkg/common"
"github.com/nektos/act/pkg/model"
"github.com/sirupsen/logrus"
)

type jobInfo interface {
Expand Down Expand Up @@ -113,7 +114,10 @@ func useStepLogger(rc *RunContext, stepModel *model.Step, stage stepStage, execu
return func(ctx context.Context) error {
ctx = withStepLogger(ctx, stepModel.ID, stepModel.String(), stage.String())

rawLogger := common.Logger(ctx).WithField("raw_output", true)
rawLogger := common.Logger(ctx).WithFields(logrus.Fields{
"raw_output": true,
"stage": stage.String(),
})
logWriter := common.NewLineWriter(rc.commandHandler(ctx), func(s string) bool {
if rc.Config.LogOutput {
rawLogger.Infof("%s", s)
Expand Down

0 comments on commit eaea781

Please sign in to comment.