@@ -143,7 +143,7 @@ class ExtensionHostManager extends Disposable implements IExtensionHostManager {
143
143
} ;
144
144
this . _telemetryService . publicLog2 < ExtensionHostStartupEvent , ExtensionHostStartupClassification > ( 'extensionHostStartup' , successTelemetryEvent ) ;
145
145
146
- return this . _createExtensionHostCustomers ( protocol ) ;
146
+ return this . _createExtensionHostCustomers ( this . kind , protocol ) ;
147
147
} ,
148
148
( err ) => {
149
149
this . _logService . error ( `Error received from starting extension host (kind: ${ extensionHostKindToString ( this . kind ) } )` ) ;
@@ -258,11 +258,11 @@ class ExtensionHostManager extends Disposable implements IExtensionHostManager {
258
258
return ExtensionHostManager . _convert ( SIZE , sw . elapsed ( ) ) ;
259
259
}
260
260
261
- private _createExtensionHostCustomers ( protocol : IMessagePassingProtocol ) : IExtensionHostProxy {
261
+ private _createExtensionHostCustomers ( kind : ExtensionHostKind , protocol : IMessagePassingProtocol ) : IExtensionHostProxy {
262
262
263
263
let logger : IRPCProtocolLogger | null = null ;
264
264
if ( LOG_EXTENSION_HOST_COMMUNICATION || this . _environmentService . logExtensionHostCommunication ) {
265
- logger = new RPCLogger ( ) ;
265
+ logger = new RPCLogger ( kind ) ;
266
266
}
267
267
268
268
this . _rpcProtocol = new RPCProtocol ( protocol , logger ) ;
@@ -643,12 +643,16 @@ class RPCLogger implements IRPCProtocolLogger {
643
643
private _totalIncoming = 0 ;
644
644
private _totalOutgoing = 0 ;
645
645
646
+ constructor (
647
+ private readonly _kind : ExtensionHostKind
648
+ ) { }
649
+
646
650
private _log ( direction : string , totalLength : number , msgLength : number , req : number , initiator : RequestInitiator , str : string , data : any ) : void {
647
651
data = pretty ( data ) ;
648
652
649
653
const colorTable = colorTables [ initiator ] ;
650
654
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 } ` ] ;
652
656
if ( / \( $ / . test ( str ) ) {
653
657
args = args . concat ( data ) ;
654
658
args . push ( ')' ) ;
0 commit comments