diff --git a/checker/check_runner.go b/checker/check_runner.go index 7c4e7ad3b8ab..49195dd9359b 100644 --- a/checker/check_runner.go +++ b/checker/check_runner.go @@ -79,12 +79,11 @@ func (r *Runner) Run(ctx context.Context, c Check) CheckResult { startTime := time.Now() var res CheckResult - var l logger + l := NewLogger() for retriesRemaining := checkRetries; retriesRemaining > 0; retriesRemaining-- { checkRequest := r.CheckRequest checkRequest.Ctx = ctx - l = logger{} - checkRequest.Dlogger = &l + checkRequest.Dlogger = l res = c.Fn(&checkRequest) if res.Error2 != nil && errors.Is(res.Error2, sce.ErrRepoUnreachable) { checkRequest.Dlogger.Warn(&LogMessage{ diff --git a/checker/detail_logger_impl.go b/checker/detail_logger_impl.go index 6aa1e3c18563..1eca8838dda6 100644 --- a/checker/detail_logger_impl.go +++ b/checker/detail_logger_impl.go @@ -18,6 +18,10 @@ type logger struct { logs []CheckDetail } +func NewLogger() *logger { + return &logger{} +} + func (l *logger) Info(msg *LogMessage) { cd := CheckDetail{ Type: DetailInfo,