MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / write

Method write

src/utils/logger.ts:56–69  ·  view source on GitHub ↗
(level: LogLevel, msg: string, meta?: Record<string, unknown>)

Source from the content-addressed store, hash-verified

54 }
55
56 private async write(level: LogLevel, msg: string, meta?: Record<string, unknown>): Promise<void> {
57 if (LEVEL_PRIORITY[level] < LEVEL_PRIORITY[this.minLevel]) return;
58 const ts = new Date().toISOString();
59 const metaStr = meta ? ' ' + JSON.stringify(meta) : '';
60 const line = `${ts} [${level.toUpperCase()}] ${msg}${metaStr}`;
61
62 if (!this.initialized) {
63 this.buffer.push(line);
64 return;
65 }
66 try {
67 await fs.appendFile(this.logFile, line + '\n');
68 } catch { /* intentional: logger must never throw */ }
69 }
70
71 debug(msg: string, meta?: Record<string, unknown>): void { void this.write('debug', msg, meta); }
72 info(msg: string, meta?: Record<string, unknown>): void { void this.write('info', msg, meta); }

Callers 15

debugMethod · 0.95
infoMethod · 0.95
warnMethod · 0.95
errorMethod · 0.95
runTaskFunction · 0.45
server.pyFile · 0.45
_get_modelFunction · 0.45
mainFunction · 0.45
index.tsFile · 0.45
sendInputFunction · 0.45
executeMethod · 0.45

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected