MCPcopy Create free account
hub / github.com/PasarGuard/node / captureProcessLogs

Method captureProcessLogs

backend/xray/log.go:32–48  ·  view source on GitHub ↗
(ctx context.Context, pipe io.Reader)

Source from the content-addressed store, hash-verified

30}
31
32func (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
50func (c *Core) recordProcessLog(output string) {
51 if c.isStartupLogPhase() {

Callers 1

StartMethod · 0.95

Calls 3

isStartupLogPhaseMethod · 0.95
captureStartupLogLineMethod · 0.95
captureRuntimeLogLineMethod · 0.95

Tested by

no test coverage detected