(chunk)
| 231 | } |
| 232 | |
| 233 | async _processChunk(chunk) { |
| 234 | const prevProcessedInputChars = this._processedInputChars; |
| 235 | let end = chunk.length; |
| 236 | let current = 0; |
| 237 | let next = 0; |
| 238 | let line; |
| 239 | try { |
| 240 | while (current < end) { |
| 241 | next = chunk.indexOf('\n', current); |
| 242 | if (next === -1) { |
| 243 | this._chunkRemainder += chunk.substring(current); |
| 244 | break; |
| 245 | } |
| 246 | line = chunk.substring(current, next); |
| 247 | if (this._chunkRemainder) { |
| 248 | line = this._chunkRemainder + line; |
| 249 | this._chunkRemainder = ''; |
| 250 | } |
| 251 | current = next + 1; |
| 252 | this._lineNumber++; |
| 253 | await this.processLogLine(line); |
| 254 | this._processedInputChars = prevProcessedInputChars + current; |
| 255 | } |
| 256 | this._updateProgress(); |
| 257 | } catch (e) { |
| 258 | console.error(`Could not parse log line ${ |
| 259 | this._lineNumber}, trying to continue: ${e}`); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | async processLogFile(fileName) { |
| 264 | this.collectEntries = true; |
no test coverage detected