MCPcopy Index your code
hub / github.com/Marus/cortex-debug / ServerConsoleLog

Function ServerConsoleLog

src/backend/server.ts:12–32  ·  view source on GitHub ↗
(str: string, usePid?: number)

Source from the content-addressed store, hash-verified

10
11export let GdbPid = -1;
12export function ServerConsoleLog(str: string, usePid?: number) {
13 if (!str) { return; }
14 try {
15 const tmpDirName = os.tmpdir();
16 const date = new Date();
17 if (usePid) {
18 GdbPid = usePid;
19 }
20 str = `[${date.toISOString()}] ppid=${process.pid} pid=${GdbPid} ` + str;
21 // console.log(str);
22 if (true) {
23 if (!str.endsWith('\n')) {
24 str += '\n';
25 }
26 fs.appendFileSync(path.join(tmpDirName, 'cortex-debug-server-exiting.log'), str);
27 }
28 }
29 catch (e) {
30 console.log(e ? e.toString() : 'unknown exception?');
31 }
32}
33
34let currentServers: GDBServer[] = [];
35export class GDBServer extends EventEmitter {

Callers 13

serverConsoleLogMethod · 0.90
receivedCustomEventMethod · 0.90
endChainedConfigsMethod · 0.90
startMethod · 0.90
onExitMethod · 0.90
tryKillMethod · 0.90
startKillTimeoutMethod · 0.90
stopMethod · 0.90
detachMethod · 0.90
initMethod · 0.85
exitMethod · 0.85
onExitMethod · 0.85

Calls 2

logMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected