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

Function interceptStderrWrite

src/logger.ts:84–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82}
83
84function interceptStderrWrite() {
85 const originalStderrWrite = process.stderr.write;
86 process.stderr.write = (data, ...args) => {
87 const {encoding, cb} = splitArgs(args);
88 const modifiedData = getModifiedData(data, encoding, true);
89 return originalStderrWrite.apply(process.stderr, [modifiedData, cb]);
90 };
91}
92
93// eslint-disable-next-line @typescript-eslint/no-explicit-any
94export function splitArgs(args: any[]) {

Callers 1

Calls 2

splitArgsFunction · 0.85
getModifiedDataFunction · 0.85

Tested by

no test coverage detected