diff --git a/src/Server/LanguageServer.cs b/src/Server/LanguageServer.cs index 136fa5d92..234ce0e86 100644 --- a/src/Server/LanguageServer.cs +++ b/src/Server/LanguageServer.cs @@ -40,7 +40,16 @@ public LanguageServer( Stream input, Stream output, ILoggerFactory loggerFactory) - : this(input, output, new LspReciever(), new RequestProcessIdentifier(), loggerFactory, new Serializer()) + : this(input, output, loggerFactory, addDefaultLoggingProvider: true) + { + } + + public LanguageServer( + Stream input, + Stream output, + ILoggerFactory loggerFactory, + bool addDefaultLoggingProvider) + : this(input, output, new LspReciever(), new RequestProcessIdentifier(), loggerFactory, new Serializer(), addDefaultLoggingProvider) { } @@ -50,11 +59,13 @@ internal LanguageServer( LspReciever reciever, IRequestProcessIdentifier requestProcessIdentifier, ILoggerFactory loggerFactory, - Serializer serializer) + Serializer serializer, + bool addDefaultLoggingProvider) { var outputHandler = new OutputHandler(output, serializer); - // TODO: This might not be the best - loggerFactory.AddProvider(new LanguageServerLoggerProvider(this)); + + if (addDefaultLoggingProvider) + loggerFactory.AddProvider(new LanguageServerLoggerProvider(this)); _reciever = reciever; _loggerFactory = loggerFactory;