* Process a chunk of data, splitting on newlines and logging complete lines
(data: string)
| 151 | * Process a chunk of data, splitting on newlines and logging complete lines |
| 152 | */ |
| 153 | append(data: string): void { |
| 154 | this.buffer += data; |
| 155 | const lines = this.buffer.split("\n"); |
| 156 | this.buffer = lines.pop() ?? ""; // Keep last incomplete line |
| 157 | for (const line of lines) { |
| 158 | if (line) this.logLine(line); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Flush any remaining buffered data (called when stream closes) |
no outgoing calls