MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/functions-framework-nodejs / interceptStdoutWrite

Function interceptStdoutWrite

src/logger.ts:75–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75function interceptStdoutWrite() {
76 const originalStdoutWrite = process.stdout.write;
77 process.stdout.write = (data, ...args) => {
78 const {encoding, cb} = splitArgs(args);
79 const modifiedData = getModifiedData(data, encoding);
80 return originalStdoutWrite.apply(process.stdout, [modifiedData, cb]);
81 };
82}
83
84function interceptStderrWrite() {
85 const originalStderrWrite = process.stderr.write;

Callers 1

Calls 2

splitArgsFunction · 0.85
getModifiedDataFunction · 0.85

Tested by

no test coverage detected