@@ -29,7 +29,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
29
29
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations' ;
30
30
import { LocalizationsService } from 'vs/platform/localizations/node/localizations' ;
31
31
import { ConsoleLogger , getLogLevel , ILoggerService , ILogService , MultiplexLogService } from 'vs/platform/log/common/log' ;
32
- import { FollowerLogService , LoggerChannel , LoggerChannelClient } from 'vs/platform/log/common/logIpc' ;
32
+ import { LoggerChannel } from 'vs/platform/log/common/logIpc' ;
33
33
import { LoggerService } from 'vs/platform/log/node/loggerService' ;
34
34
import { SpdLogLogger } from 'vs/platform/log/node/spdlogLog' ;
35
35
import product from 'vs/platform/product/common/product' ;
@@ -217,25 +217,30 @@ export class Vscode {
217
217
https://github.com/cdr/code-server/blob/main/lib/vscode/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts#L148
218
218
219
219
If upstream changes cause conflicts, look there ^.
220
+ 3/11/21 @jsjoeio
220
221
*/
221
222
const environmentService = new NativeEnvironmentService ( args ) ;
222
223
// https://github.com/cdr/code-server/issues/1693
223
224
fs . mkdirSync ( environmentService . globalStorageHome . fsPath , { recursive : true } ) ;
224
225
/*
225
- NOTE@coder: Made these updates on 3/11/21 by @jsjoeio
226
- based on this file (and lines):
226
+ NOTE@coder: Made these updates on based on this file (and lines):
227
227
https://github.com/cdr/code-server/blob/main/lib/vscode/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts#L144-L149
228
+
229
+ More details (from @code-asher):
230
+ I think the logLevel channel is only used in the electron version of vscode so we can probably skip it.
231
+ With that in mind we wouldn't need logLevelClient which means we wouldn't need the follower service
232
+ either and we can use the multiplex log service directly.
233
+ 3/11/21 @jsjoeio
228
234
*/
229
- const mainRouter = new StaticRouter ( ctx => ctx === 'main' )
230
- const loggerClient = new LoggerChannelClient ( this . ipc . getChannel ( 'logger' , mainRouter ) )
231
- const multiplexLogger = new MultiplexLogService ( [
235
+ const logService = new MultiplexLogService ( [
232
236
new ConsoleLogger ( getLogLevel ( environmentService ) ) ,
233
237
new SpdLogLogger ( RemoteExtensionLogFileName , environmentService . logsPath , false , getLogLevel ( environmentService ) )
234
238
] )
235
- const logService = new FollowerLogService ( loggerClient , multiplexLogger )
236
239
const fileService = new FileService ( logService ) ;
237
240
fileService . registerProvider ( Schemas . file , new DiskFileSystemProvider ( logService ) ) ;
238
241
242
+ const loggerService = new LoggerService ( logService , fileService )
243
+
239
244
const piiPaths = [
240
245
path . join ( environmentService . userDataPath , 'clp' ) , // Language packs.
241
246
environmentService . appRoot ,
@@ -245,13 +250,17 @@ export class Vscode {
245
250
...environmentService . extraBuiltinExtensionPaths ,
246
251
] ;
247
252
248
- this . ipc . registerChannel ( 'logger' , new LoggerChannel ( logService ) ) ;
253
+ this . ipc . registerChannel ( 'logger' , new LoggerChannel ( loggerService ) ) ;
249
254
this . ipc . registerChannel ( ExtensionHostDebugBroadcastChannel . ChannelName , new ExtensionHostDebugBroadcastChannel ( ) ) ;
250
255
251
256
this . services . set ( ILogService , logService ) ;
252
257
this . services . set ( IEnvironmentService , environmentService ) ;
253
258
this . services . set ( INativeEnvironmentService , environmentService ) ;
254
- this . services . set ( ILoggerService , new SyncDescriptor ( LoggerService ) ) ;
259
+ /*
260
+ NOTE@coder: we changed this from LoggerService to the loggerService defined above.
261
+ 3/11/21 @jsjoeio
262
+ */
263
+ this . services . set ( ILoggerService , loggerService ) ;
255
264
256
265
const configurationService = new ConfigurationService ( environmentService . settingsResource , fileService ) ;
257
266
await configurationService . initialize ( ) ;
0 commit comments