Skip to content

Commit

Permalink
Fix misleading logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed Aug 4, 2023
1 parent c0e4fb4 commit 66a6176
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public LanguageServerHost(Stream inputStream, Stream outputStream, ExportProvide

public void Start()
{
_logger.LogInformation("Starting server...");
_jsonRpc.StartListening();

// Now that the server is started, update the our instance reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation
));
});

var logger = loggerFactory.CreateLogger<Program>();

if (serverConfiguration.LaunchDebugger)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
Expand All @@ -60,7 +62,6 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation
}
else
{
var logger = loggerFactory.CreateLogger<Program>();
var timeout = TimeSpan.FromMinutes(1);
logger.LogCritical($"Server started with process ID {Environment.ProcessId}");
logger.LogCritical($"Waiting {timeout:g} for a debugger to attach");
Expand Down Expand Up @@ -103,6 +104,8 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation
var server = new LanguageServerHost(Console.OpenStandardInput(), Console.OpenStandardOutput(), exportProvider, loggerFactory.CreateLogger(nameof(LanguageServerHost)));
server.Start();

logger.LogInformation("Language server initialized");

try
{
await server.WaitForExitAsync();
Expand Down

0 comments on commit 66a6176

Please sign in to comment.