(options: {
writeFn: (content: string) => void
flushIntervalMs?: number
maxBufferSize?: number
})
| 45 | } |
| 46 | |
| 47 | function createJsonlWriter(options: { |
| 48 | writeFn: (content: string) => void |
| 49 | flushIntervalMs?: number |
| 50 | maxBufferSize?: number |
| 51 | }): JsonlWriter { |
| 52 | const writer = createBufferedWriter(options) |
| 53 | return { |
| 54 | write(obj: object): void { |
| 55 | writer.write(jsonStringify(obj) + '\n') |
| 56 | }, |
| 57 | flush: writer.flush, |
| 58 | dispose: writer.dispose, |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // Buffered writers for JSONL log files, keyed by path |
| 63 | const logWriters = new Map<string, JsonlWriter>() |
no test coverage detected