feat: add json logger output (#1026)

* feat: add json logger output

This will allow to format log output as json.
This is helpful in cases where act is not executed on a 'local' machine.

* refactor: use runner config

Using the runner config to configure logging is cleaner.

Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Markus Wolf
2022-03-14 16:33:11 +01:00
committed by GitHub
parent 7d403b8307
commit 14c98015c5
5 changed files with 70 additions and 31 deletions

View File

@@ -31,6 +31,7 @@ type Config struct {
ForcePull bool // force pulling of the image, even if already present
ForceRebuild bool // force rebuilding local docker image action
LogOutput bool // log the output from docker run
JSONLogger bool // use json or text logger
Env map[string]string // env for containers
Secrets map[string]string // list of secrets
InsecureSecrets bool // switch hiding output when printing to terminal
@@ -164,7 +165,7 @@ func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor {
}
return nil
})(common.WithJobErrorContainer(WithJobLogger(ctx, jobName, rc.Config.Secrets, rc.Config.InsecureSecrets, &rc.Masks)))
})(common.WithJobErrorContainer(WithJobLogger(ctx, jobName, rc.Config, &rc.Masks)))
})
}
pipeline = append(pipeline, common.NewParallelExecutor(maxParallel, stageExecutor...))