(
type: 'stderr' | 'stdout',
taskId: string,
content: string,
size: number,
origin?: string,
)
| 106 | } |
| 107 | |
| 108 | function sendLog( |
| 109 | type: 'stderr' | 'stdout', |
| 110 | taskId: string, |
| 111 | content: string, |
| 112 | size: number, |
| 113 | origin?: string, |
| 114 | ) { |
| 115 | const timer = timers.get(taskId)! |
| 116 | const time = type === 'stderr' ? timer.stderrTime : timer.stdoutTime |
| 117 | state().rpc.onUserConsoleLog({ |
| 118 | type, |
| 119 | content: content || '<empty line>', |
| 120 | taskId, |
| 121 | time: time || RealDate.now(), |
| 122 | size, |
| 123 | origin, |
| 124 | }) |
| 125 | } |
| 126 | |
| 127 | const stdout = new Writable({ |
| 128 | write(data, encoding, callback) { |
no test coverage detected