MCPcopy Create free account
hub / github.com/Marus/cortex-debug / logDataStatic

Method logDataStatic

src/frontend/server_console.ts:236–254  ·  view source on GitHub ↗
(ptyTerm: PtyTerminal, data: Buffer | string)

Source from the content-addressed store, hash-verified

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();

Callers 2

logDataMethod · 0.80
debugMsgStaticMethod · 0.80

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected