MCPcopy Create free account
hub / github.com/cloudflare/computer / writeBoth

Function writeBoth

packages/computerd/src/cli/logger.ts:85–90  ·  view source on GitHub ↗
(level: LogLevel, original: (...args: unknown[]) => void)

Source from the content-addressed store, hash-verified

83 const callLog = originalLog.bind(console);
84 const callError = originalError.bind(console);
85 const writeBoth = (level: LogLevel, original: (...args: unknown[]) => void) => {
86 return (...args: unknown[]): void => {
87 original(...args);
88 file?.write(level, args);
89 };
90 };
91 console.log = writeBoth("info", callLog);
92 console.error = writeBoth("error", callError);
93

Callers 1

installLoggingFunction · 0.85

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected