diff --git a/pkg/shell-operator/operator.go b/pkg/shell-operator/operator.go index 91feb723..73306142 100644 --- a/pkg/shell-operator/operator.go +++ b/pkg/shell-operator/operator.go @@ -83,6 +83,10 @@ func NewShellOperator(ctx context.Context, opts ...Option) *ShellOperator { opt(so) } + if so.logger == nil { + so.logger = log.NewLogger(log.Options{}).Named("shell-operator") + } + return so } diff --git a/test/utils/jsonloganalyzer.go b/test/utils/jsonloganalyzer.go index c6ae8396..a95a1ae1 100644 --- a/test/utils/jsonloganalyzer.go +++ b/test/utils/jsonloganalyzer.go @@ -29,11 +29,11 @@ func NewJsonLogAnalyzer() *JsonLogAnalyzer { } func (a *JsonLogAnalyzer) AddGroup(analyzers ...*JsonLogMatcher) { - r.Matchers = append(r.Matchers, analyzers) + a.Matchers = append(a.Matchers, analyzers) } func (a *JsonLogAnalyzer) OnStop(fn func()) { - r.OnStopFn = fn + a.OnStopFn = fn } func (a *JsonLogAnalyzer) Finished() bool {