(ctx context.Context, pipe io.Reader)
| 30 | } |
| 31 | |
| 32 | func (c *Core) captureProcessLogs(ctx context.Context, pipe io.Reader) { |
| 33 | scanner := bufio.NewScanner(pipe) |
| 34 | scanner.Buffer(make([]byte, 64*1024), 1024*1024) |
| 35 | for scanner.Scan() { |
| 36 | select { |
| 37 | case <-ctx.Done(): |
| 38 | return // Exit gracefully if stop signal received |
| 39 | default: |
| 40 | output := scanner.Text() |
| 41 | if c.isStartupLogPhase() { |
| 42 | c.captureStartupLogLine(output) |
| 43 | continue |
| 44 | } |
| 45 | c.captureRuntimeLogLine(output) |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func (c *Core) recordProcessLog(output string) { |
| 51 | if c.isStartupLogPhase() { |
no test coverage detected