()
| 112 | * inherited fd 2, bypassing this wrapper — it stamps that line itself.) |
| 113 | */ |
| 114 | export function timestampStderrLines(): void { |
| 115 | const orig = process.stderr.write.bind(process.stderr); |
| 116 | process.stderr.write = ((chunk: string | Uint8Array, ...rest: unknown[]) => { |
| 117 | return (orig as (...args: unknown[]) => boolean)(stampLogChunk(chunk), ...rest); |
| 118 | }) as typeof process.stderr.write; |
| 119 | } |
| 120 | |
| 121 | /** Prepend `[<ISO-8601>] ` to a log chunk; unknown chunk types pass through. */ |
| 122 | export function stampLogChunk(chunk: string | Uint8Array): string | Uint8Array { |
no test coverage detected