MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / openFileSink

Function openFileSink

src/workspaces/logger.ts:24–33  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

22const fileStream = openFileSink(FILE_PATH);
23
24function openFileSink(path: string): WriteStream | null {
25 try {
26 mkdirSync(dirname(path), { recursive: true });
27 const s = createWriteStream(path, { flags: 'a' });
28 s.on('error', () => { /* swallow — never take down spawn lifecycle */ });
29 return s;
30 } catch {
31 return null;
32 }
33}
34
35function write(level: Level, msg: string, fields: Record<string, unknown>, toConsole: boolean): void {
36 const record: Record<string, unknown> = {

Callers 1

logger.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected