batch logs output to speedup command

pull/11274/head
Steven Powell 2021-05-03 17:39:46 -07:00
parent 073ae7efe5
commit 616401e3e6
1 changed files with 6 additions and 2 deletions

View File

@ -184,10 +184,12 @@ func Output(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg config.Cluster
failed = append(failed, name)
continue
}
l := ""
scanner := bufio.NewScanner(&b)
for scanner.Scan() {
out.Styled(style.Empty, scanner.Text())
l += scanner.Text() + "\n"
}
out.Styled(style.Empty, l)
}
if len(failed) > 0 {
@ -223,10 +225,12 @@ func outputLastStart() error {
return fmt.Errorf("failed to open file %s: %v", fp, err)
}
defer f.Close()
l := ""
s := bufio.NewScanner(f)
for s.Scan() {
out.Styled(style.Empty, s.Text())
l += s.Text() + "\n"
}
out.Styled(style.Empty, l)
if err := s.Err(); err != nil {
return fmt.Errorf("failed to read file %s: %v", fp, err)
}