Skip to content

Commit

Permalink
Merge pull request #66 from tintoy/fix/router-log-level
Browse files Browse the repository at this point in the history
Enable opting out of built-in logger provider.
  • Loading branch information
david-driscoll authored Jan 31, 2018
2 parents 79abb1a + 05e2287 commit 6960413
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/Server/LanguageServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand All @@ -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;
Expand Down

0 comments on commit 6960413

Please sign in to comment.