@@ -143,7 +143,7 @@ class ExtensionHostManager extends Disposable implements IExtensionHostManager {
143143 } ;
144144 this . _telemetryService . publicLog2 < ExtensionHostStartupEvent , ExtensionHostStartupClassification > ( 'extensionHostStartup' , successTelemetryEvent ) ;
145145
146- return this . _createExtensionHostCustomers ( protocol ) ;
146+ return this . _createExtensionHostCustomers ( this . kind , protocol ) ;
147147 } ,
148148 ( err ) => {
149149 this . _logService . error ( `Error received from starting extension host (kind: ${ extensionHostKindToString ( this . kind ) } )` ) ;
@@ -258,11 +258,11 @@ class ExtensionHostManager extends Disposable implements IExtensionHostManager {
258258 return ExtensionHostManager . _convert ( SIZE , sw . elapsed ( ) ) ;
259259 }
260260
261- private _createExtensionHostCustomers ( protocol : IMessagePassingProtocol ) : IExtensionHostProxy {
261+ private _createExtensionHostCustomers ( kind : ExtensionHostKind , protocol : IMessagePassingProtocol ) : IExtensionHostProxy {
262262
263263 let logger : IRPCProtocolLogger | null = null ;
264264 if ( LOG_EXTENSION_HOST_COMMUNICATION || this . _environmentService . logExtensionHostCommunication ) {
265- logger = new RPCLogger ( ) ;
265+ logger = new RPCLogger ( kind ) ;
266266 }
267267
268268 this . _rpcProtocol = new RPCProtocol ( protocol , logger ) ;
@@ -643,12 +643,16 @@ class RPCLogger implements IRPCProtocolLogger {
643643 private _totalIncoming = 0 ;
644644 private _totalOutgoing = 0 ;
645645
646+ constructor (
647+ private readonly _kind : ExtensionHostKind
648+ ) { }
649+
646650 private _log ( direction : string , totalLength : number , msgLength : number , req : number , initiator : RequestInitiator , str : string , data : any ) : void {
647651 data = pretty ( data ) ;
648652
649653 const colorTable = colorTables [ initiator ] ;
650654 const color = LOG_USE_COLORS ? colorTable [ req % colorTable . length ] : '#000000' ;
651- let args = [ `%c[${ direction } ]%c[${ String ( totalLength ) . padStart ( 7 ) } ]%c[len: ${ String ( msgLength ) . padStart ( 5 ) } ]%c${ String ( req ) . padStart ( 5 ) } - ${ str } ` , 'color: darkgreen' , 'color: grey' , 'color: grey' , `color: ${ color } ` ] ;
655+ let args = [ `%c[${ extensionHostKindToString ( this . _kind ) } ][ ${ direction } ]%c[${ String ( totalLength ) . padStart ( 7 ) } ]%c[len: ${ String ( msgLength ) . padStart ( 5 ) } ]%c${ String ( req ) . padStart ( 5 ) } - ${ str } ` , 'color: darkgreen' , 'color: grey' , 'color: grey' , `color: ${ color } ` ] ;
652656 if ( / \( $ / . test ( str ) ) {
653657 args = args . concat ( data ) ;
654658 args . push ( ')' ) ;
0 commit comments