MCPcopy Create free account
hub / github.com/garrytan/gstack / logGbrainError

Function logGbrainError

lib/gstack-memory-helpers.ts:261–271  ·  view source on GitHub ↗
(kind: string, detail: string)

Source from the content-addressed store, hash-verified

259
260// Best-effort JSONL append to ~/.gstack/.gbrain-errors.jsonl. Never throws.
261function logGbrainError(kind: string, detail: string): void {
262 try {
263 const path = errorLogPath();
264 mkdirSync(dirname(path), { recursive: true });
265 appendFileSync(
266 path,
267 JSON.stringify({ ts: new Date().toISOString(), kind, detail: detail.slice(0, 500) }) + "\n",
268 "utf-8"
269 );
270 } catch { /* logging is best-effort */ }
271}
272
273function freshDetectEngineTier(): EngineDetect {
274 const now = Date.now();

Callers 1

freshDetectEngineTierFunction · 0.85

Calls 1

errorLogPathFunction · 0.85

Tested by

no test coverage detected