in logger/common.go [160:196]
func (l *Logger) Start(
ctx context.Context,
uid int,
gid int,
cleanupTime *time.Duration,
ready func() error,
) error {
pipeNameToPipe, err := l.GetPipes()
if err != nil {
return err
}
errGroup, ctx := errgroup.WithContext(ctx)
for pn, p := range pipeNameToPipe {
// Copy pn and p to new variables source and pipe, accordingly.
source := pn
pipe := p
errGroup.Go(func() error {
logErr := l.sendLogs(ctx, pipe, source, uid, gid, cleanupTime)
if logErr != nil {
err := errors.Wrapf(logErr, "failed to send logs from pipe %s", source)
debug.SendEventsToLog(DaemonName, err.Error(), debug.ERROR, 1)
return err
}
return nil
})
}
// Signal that the container is ready to be started
if err := ready(); err != nil {
return errors.Wrap(err, "failed to check container ready status")
}
// Wait() will return the first error it receives.
return errGroup.Wait()
}