(ptyTerm: PtyTerminal, data: Buffer | string)
| 234 | } |
| 235 | |
| 236 | public static logDataStatic(ptyTerm: PtyTerminal, data: Buffer | string) { |
| 237 | try { |
| 238 | if (consoleLogFd >= 0) { |
| 239 | if (!ptyTerm || !ptyTerm.isReady) { |
| 240 | // Maybe we should do our own buffering rather than the pty doing it. This can |
| 241 | // help if the user kills the terminal. But we would have lost previous data anyways |
| 242 | const date = new Date(); |
| 243 | const msg = `[${date.toISOString()}] SERVER CONSOLE DEBUG: ******* Terminal not yet ready, buffering... ******`; |
| 244 | // console.log(msg); |
| 245 | // fs.writeFileSync(logFd, msg); |
| 246 | } |
| 247 | fs.writeFileSync(consoleLogFd, data.toString()); |
| 248 | fs.fdatasyncSync(consoleLogFd); |
| 249 | } |
| 250 | } |
| 251 | catch (e) { |
| 252 | consoleLogFd = -1; |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | public dispose() { |
| 257 | GDBServerConsoleInstance.disposeAll(); |
no test coverage detected