MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / writeLogChunk

Function writeLogChunk

packages/codex-native-api/src/daemon_manager.ts:1282–1290  ·  view source on GitHub ↗
(filePath: string, streamName: 'stdout' | 'stderr', chunk: unknown)

Source from the content-addressed store, hash-verified

1280}
1281
1282function writeLogChunk(filePath: string, streamName: 'stdout' | 'stderr', chunk: unknown): void {
1283 const text = Buffer.isBuffer(chunk) ? chunk.toString('utf8') : String(chunk);
1284 if (streamName === 'stderr') {
1285 process.stderr.write(text);
1286 } else {
1287 process.stdout.write(text);
1288 }
1289 fs.appendFile(filePath, text, () => {});
1290}
1291
1292function writeLogLine(filePath: string, streamName: 'stdout' | 'stderr', line: string): void {
1293 writeLogChunk(filePath, streamName, `${new Date().toISOString()} ${line}\n`);

Callers 2

runSupervisorChildFunction · 0.85
writeLogLineFunction · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected