1616
1717import { EventEmitter } from './eventEmitter' ;
1818import { ValidationError , maybeFindValidator } from '../protocol/validator' ;
19- import { isUnderTest } from '../utils/debug' ;
20- import { debugLogger } from '../utils/debugLogger' ;
19+ import { isUnderTest } from '../utils/isomorphic/debug' ;
2120import { captureLibraryStackTrace , stringifyStackFrames } from '../utils/isomorphic/stackTrace' ;
2221import { zones } from '../utils/zones' ;
2322
2423import type { ClientInstrumentation } from './clientInstrumentation' ;
2524import type { Connection } from './connection' ;
2625import type { Logger } from './types' ;
2726import type { ValidatorContext } from '../protocol/validator' ;
28- import type { Platform } from '../utils /platform' ;
27+ import type { Platform } from '../common /platform' ;
2928import type * as channels from '@protocol/channels' ;
3029
3130type Listener = ( ...args : any [ ] ) => void ;
@@ -158,7 +157,7 @@ export abstract class ChannelOwner<T extends channels.Channel = channels.Channel
158157 apiZone . params = params ;
159158 apiZone . reported = true ;
160159 this . _instrumentation . onApiCallBegin ( apiZone ) ;
161- logApiCall ( this . _logger , `=> ${ apiZone . apiName } started` ) ;
160+ logApiCall ( this . _platform , this . _logger , `=> ${ apiZone . apiName } started` ) ;
162161 return await this . _connection . sendMessageToServer ( this , prop , validatedParams , apiZone . apiName , apiZone . frames , apiZone . stepId ) ;
163162 }
164163 // Since this api call is either internal, or has already been reported/traced once,
@@ -189,7 +188,7 @@ export abstract class ChannelOwner<T extends channels.Channel = channels.Channel
189188 try {
190189 const result = await zones . run ( 'apiZone' , apiZone , async ( ) => await func ( apiZone ) ) ;
191190 if ( ! isInternal ) {
192- logApiCall ( logger , `<= ${ apiZone . apiName } succeeded` ) ;
191+ logApiCall ( this . _platform , logger , `<= ${ apiZone . apiName } succeeded` ) ;
193192 this . _instrumentation . onApiCallEnd ( apiZone ) ;
194193 }
195194 return result ;
@@ -204,7 +203,7 @@ export abstract class ChannelOwner<T extends channels.Channel = channels.Channel
204203 e . stack = '' ;
205204 if ( ! isInternal ) {
206205 apiZone . error = e ;
207- logApiCall ( logger , `<= ${ apiZone . apiName } failed` ) ;
206+ logApiCall ( this . _platform , logger , `<= ${ apiZone . apiName } failed` ) ;
208207 this . _instrumentation . onApiCallEnd ( apiZone ) ;
209208 }
210209 throw e ;
@@ -227,10 +226,10 @@ export abstract class ChannelOwner<T extends channels.Channel = channels.Channel
227226 }
228227}
229228
230- function logApiCall ( logger : Logger | undefined , message : string ) {
229+ function logApiCall ( platform : Platform , logger : Logger | undefined , message : string ) {
231230 if ( logger && logger . isEnabled ( 'api' , 'info' ) )
232231 logger . log ( 'api' , 'info' , message , [ ] , { color : 'cyan' } ) ;
233- debugLogger . log ( 'api' , message ) ;
232+ platform . log ( 'api' , message ) ;
234233}
235234
236235function tChannelImplToWire ( names : '*' | string [ ] , arg : any , path : string , context : ValidatorContext ) {
0 commit comments