11// Copyright (c) Microsoft Corporation. All rights reserved. 
22// Licensed under the MIT License. 
3- import  {  inject ,  injectable ,  named  }  from  'inversify' ; 
4- import  {  STANDARD_OUTPUT_CHANNEL  }  from  '../constants' ; 
53
4+ 'use strict' ; 
5+ 
6+ import  {  inject ,  injectable ,  named  }  from  'inversify' ; 
7+ import  {  workspace  }  from  'vscode' ; 
8+ import  {  isCI ,  isTestExecution ,  STANDARD_OUTPUT_CHANNEL  }  from  '../constants' ; 
69import  {  traceInfo  }  from  '../logger' ; 
710import  {  IOutputChannel ,  IPathUtils  }  from  '../types' ; 
811import  {  Logging  }  from  '../utils/localize' ; 
@@ -13,9 +16,18 @@ export class ProcessLogger implements IProcessLogger {
1316 constructor ( 
1417 @inject ( IOutputChannel )  @named ( STANDARD_OUTPUT_CHANNEL )  private  readonly  outputChannel : IOutputChannel , 
1518 @inject ( IPathUtils )  private  readonly  pathUtils : IPathUtils 
16-  )  { } 
19+  )  {   } 
1720
1821 public  logProcess ( file : string ,  args : string [ ] ,  options ?: SpawnOptions )  { 
22+  if  ( 
23+  ! isTestExecution ( )  && 
24+  isCI  && 
25+  ! workspace . getConfiguration ( 'python' ,  null ) . get < boolean > ( 'enableProcessLogging' ,  true ) 
26+  )  { 
27+  // Added to disable logging of process execution commands during UI Tests. 
28+  // Used only during UI Tests (hence this setting need not be exposed as a valid setting). 
29+  return ; 
30+  } 
1931 const  argsList  =  args . reduce ( ( accumulator ,  current ,  index )  =>  { 
2032 let  formattedArg  =  this . pathUtils . getDisplayName ( current ) . toCommandArgument ( ) ; 
2133 if  ( current [ 0 ]  ===  '\''  ||  current [ 0 ]  ===  '"' )  { 
0 commit comments