MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / wrap

Function wrap

apps/desktop/src/main/logger.ts:75–83  ·  view source on GitHub ↗
(level: 'info' | 'warn' | 'error')

Source from the content-addressed store, hash-verified

73 const scoped = log.scope(scope);
74 const wrap =
75 (level: 'info' | 'warn' | 'error') => (event: string, data?: Record<string, unknown>) => {
76 const runId = currentRunId();
77 const merged = runId !== undefined ? { runId, ...(data ?? {}) } : data;
78 if (merged === undefined) {
79 scoped[level](event);
80 } else {
81 scoped[level](event, merged);
82 }
83 };
84 return { info: wrap('info'), warn: wrap('warn'), error: wrap('error') };
85}
86

Callers 1

getLoggerFunction · 0.85

Calls 1

currentRunIdFunction · 0.90

Tested by

no test coverage detected