MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / logProcess

Function logProcess

src/platform/common/process/logger.node.ts:13–31  ·  view source on GitHub ↗
(file: string, args: string[], options?: SpawnOptions)

Source from the content-addressed store, hash-verified

11 * Logs the running of a new process. Does not log stdout/stderr.
12 */
13export function logProcess(file: string, args: string[], options?: SpawnOptions) {
14 const argsList = args.reduce((accumulator, current, index) => {
15 let formattedArg = toCommandArgument(current);
16 if (
17 (current.startsWith('"') && current.endsWith('"')) ||
18 (current.startsWith("'") && current.endsWith("'") && (current.includes('/') || current.includes('\\')))
19 ) {
20 formattedArg = `${current[0]}${getDisplayPath(current.substr(1))}`;
21 }
22
23 return index === 0 ? formattedArg : `${accumulator} ${formattedArg}`;
24 }, '');
25
26 const message = [`Process Execution: ${getDisplayPath(file)} ${argsList}`];
27 if (options && options.cwd) {
28 message.push(` > ${Logging.currentWorkingDirectory} ${getDisplayPath(options.cwd.toString())}`);
29 }
30 logger.info(message.join('\n'));
31}

Callers 2

execObservableMethod · 0.90
execMethod · 0.90

Calls 6

toCommandArgumentFunction · 0.90
getDisplayPathFunction · 0.90
joinMethod · 0.80
pushMethod · 0.65
toStringMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected