MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / stampLogChunk

Function stampLogChunk

src/mcp/index.ts:122–129  ·  view source on GitHub ↗
(chunk: string | Uint8Array)

Source from the content-addressed store, hash-verified

120
121/** Prepend `[<ISO-8601>] ` to a log chunk; unknown chunk types pass through. */
122export function stampLogChunk(chunk: string | Uint8Array): string | Uint8Array {
123 try {
124 const stamp = `[${new Date().toISOString()}] `;
125 if (typeof chunk === 'string') return stamp + chunk;
126 if (Buffer.isBuffer(chunk)) return Buffer.concat([Buffer.from(stamp), chunk]);
127 } catch { /* stamping is best-effort; never block the write */ }
128 return chunk;
129}
130
131/**
132 * Watchdog `progressPaths` for a server keyed on `root`'s index: the SQLite DB

Callers 2

wal-heal.test.tsFile · 0.90
timestampStderrLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected