11import  { spawn }  from  'child_process' ; 
22import  *  as  os  from  'os' ; 
3- import  { extensionOutput }  from  '../logging/extension-output' ; 
43import  { CommandResult ,  RunCliArgs ,  RunCliResult }  from  './types' ; 
4+ import  { container }  from  'tsyringe' ; 
5+ import  { ILoggerService }  from  '../services/logger-service' ; 
6+ import  { LoggerServiceSymbol }  from  '../symbols' ; 
57
68const  parseResult  =  ( out : string ) : object  =>  { 
79  let  result  =  { } ; 
@@ -17,6 +19,7 @@ const parseResult = (out: string): object => {
1719} ; 
1820
1921export  const  getRunnableCliCommand  =  ( args : RunCliArgs ) : RunCliResult  =>  { 
22+   const  logger  =  container . resolve < ILoggerService > ( LoggerServiceSymbol ) ; 
2023  const  { 
2124    cliPath, 
2225    cliEnv, 
@@ -25,7 +28,7 @@ export const getRunnableCliCommand = (args: RunCliArgs): RunCliResult => {
2528    printToOutput, 
2629  }  =  args ; 
2730
28-   extensionOutput . info ( 
31+   logger . debug ( 
2932      `Running command: "${ cliPath } ${ commandParams . join ( ' ' ) }  
3033  ) ; 
3134
@@ -39,7 +42,7 @@ export const getRunnableCliCommand = (args: RunCliArgs): RunCliResult => {
3942  } ) ; 
4043
4144  const  getCancelPromise  =  ( )  =>  new  Promise < void > ( ( resolve )  =>  { 
42-     extensionOutput . info ( 
45+     logger . debug ( 
4346        `Killing child process: "${ cliPath } ${ commandParams . join ( ' ' ) }  
4447    ) ; 
4548
@@ -58,7 +61,7 @@ export const getRunnableCliCommand = (args: RunCliArgs): RunCliResult => {
5861      } 
5962      stderr  +=  data . toString ( ) ; 
6063      if  ( printToOutput )  { 
61-         extensionOutput . debug ( data . toString ( ) ) ; 
64+         logger . debug ( data . toString ( ) ) ; 
6265      } 
6366    } ; 
6467
@@ -67,13 +70,13 @@ export const getRunnableCliCommand = (args: RunCliArgs): RunCliResult => {
6770
6871    childProcess . on ( 'exit' ,  ( code : number )  =>  { 
6972      // exit occurs earlier than close 
70-       extensionOutput . debug ( `Command exited with code: ${ code }  ) ; 
73+       logger . debug ( `Command exited with code: ${ code }  ) ; 
7174      exitCode  =  code ; 
7275    } ) ; 
7376
7477    childProcess . on ( 'close' ,  ( code : number )  =>  { 
7578      // we receive all "data" events before close 
76-       extensionOutput . debug ( `Streams of a command have been closed with code: ${ code }  ) ; 
79+       logger . debug ( `Streams of a command have been closed with code: ${ code }  ) ; 
7780      resolve ( { 
7881        exitCode : exitCode , 
7982        stderr : stderr , 
@@ -92,7 +95,7 @@ export const getRunnableCliCommand = (args: RunCliArgs): RunCliResult => {
9295
9396    childProcess . stdout ?. on ( 'data' ,  ( data )  =>  { 
9497      if  ( printToOutput )  { 
95-         extensionOutput . info ( `Command stdout: ${ data . toString ( ) }  ) ; 
98+         logger . debug ( `Command stdout: ${ data . toString ( ) }  ) ; 
9699      } 
97100
98101      if  ( ! data )  { 
0 commit comments