diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServer/Handler/Restore/RestoreHandler.cs b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServer/Handler/Restore/RestoreHandler.cs index 7f57a870a5cec..e419f2ee621c1 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServer/Handler/Restore/RestoreHandler.cs +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServer/Handler/Restore/RestoreHandler.cs @@ -106,7 +106,7 @@ private static ImmutableArray GetRestorePaths(RestoreParams request, Sol .Distinct() .ToImmutableArray(); - context.TraceInformation($"Found {projects.Length} restorable projects from {solution.Projects.Count()} projects in solution"); + context.TraceDebug($"Found {projects.Length} restorable projects from {solution.Projects.Count()} projects in solution"); return projects; } } diff --git a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Logging/LspServiceLogger.cs b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Logging/LspServiceLogger.cs index 08fb6743c888d..d12c83f0fbf50 100644 --- a/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Logging/LspServiceLogger.cs +++ b/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Logging/LspServiceLogger.cs @@ -35,7 +35,7 @@ public LspServiceLogger(ILogger hostLogger) /// /// TODO - Switch this to call LogInformation once appropriate callers have been changed to LogDebug. /// - public override void LogInformation(string message, params object[] @params) => _hostLogger.LogDebug(message, @params); + public override void LogInformation(string message, params object[] @params) => _hostLogger.LogInformation(message, @params); public override void LogWarning(string message, params object[] @params) => _hostLogger.LogWarning(message, @params); } diff --git a/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs b/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs index 89f6d1b0f1aa0..4da5e049cdbc3 100644 --- a/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs +++ b/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs @@ -181,7 +181,7 @@ protected IRequestExecutionQueue GetRequestExecutionQueue() public virtual bool TryGetLanguageForRequest(string methodName, object? serializedRequest, [NotNullWhen(true)] out string? language) { - Logger.LogInformation($"Using default language handler for {methodName}"); + Logger.LogDebug($"Using default language handler for {methodName}"); language = LanguageServerConstants.DefaultLanguageName; return true; } diff --git a/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs b/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs index d13a0415ffbd1..4fca35567d3e1 100644 --- a/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs +++ b/src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs @@ -223,7 +223,7 @@ public async Task StartRequestAsync(TRequest request, TRequ { // Record logs + metrics on cancellation. _requestTelemetryScope?.RecordCancellation(); - _logger.LogInformation($"Request was cancelled."); + _logger.LogDebug($"Request was cancelled."); _completionSource.TrySetCanceled(ex.CancellationToken); } diff --git a/src/LanguageServer/Protocol/Extensions/ProtocolConversions.cs b/src/LanguageServer/Protocol/Extensions/ProtocolConversions.cs index 1d0be6244de58..a8449c99b24c6 100644 --- a/src/LanguageServer/Protocol/Extensions/ProtocolConversions.cs +++ b/src/LanguageServer/Protocol/Extensions/ProtocolConversions.cs @@ -492,7 +492,7 @@ public static LSP.Range TextSpanToRange(TextSpan textSpan, SourceText text) if (uri == null) { - context?.TraceInformation($"Could not convert '{mappedSpan.FilePath}' to uri"); + context?.TraceWarning($"Could not convert '{mappedSpan.FilePath}' to uri"); return null; } diff --git a/src/LanguageServer/Protocol/Handler/CodeActions/CodeActionResolveHelper.cs b/src/LanguageServer/Protocol/Handler/CodeActions/CodeActionResolveHelper.cs index de8d79e7abd92..a7bfd10318aeb 100644 --- a/src/LanguageServer/Protocol/Handler/CodeActions/CodeActionResolveHelper.cs +++ b/src/LanguageServer/Protocol/Handler/CodeActions/CodeActionResolveHelper.cs @@ -30,7 +30,7 @@ internal sealed class CodeActionResolveHelper data, operations, context.GetRequiredClientCapabilities().Workspace?.WorkspaceEdit?.ResourceOperations ?? [], - context.TraceInformation, + context.TraceDebug, cancellationToken); } diff --git a/src/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs b/src/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs index a7be8405ffbb8..48d369721d0bd 100644 --- a/src/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs +++ b/src/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs @@ -51,7 +51,7 @@ public CompletionResolveHandler(IGlobalOptionService globalOptions) if (!completionListCache.TryGetCompletionListCacheEntry(completionItem, out var cacheEntry)) { // Don't have a cache associated with this completion item, cannot resolve. - context.TraceInformation("No cache entry found for the provided completion item at resolve time."); + context.TraceWarning("No cache entry found for the provided completion item at resolve time."); return Task.FromResult(completionItem); } diff --git a/src/LanguageServer/Protocol/Handler/Diagnostics/AbstractDocumentPullDiagnosticHandler.cs b/src/LanguageServer/Protocol/Handler/Diagnostics/AbstractDocumentPullDiagnosticHandler.cs index 21c18891297be..f9919ddd6afab 100644 --- a/src/LanguageServer/Protocol/Handler/Diagnostics/AbstractDocumentPullDiagnosticHandler.cs +++ b/src/LanguageServer/Protocol/Handler/Diagnostics/AbstractDocumentPullDiagnosticHandler.cs @@ -37,7 +37,7 @@ protected override ValueTask> GetOrderedDiagno var textDocument = context.TextDocument; if (textDocument is null) { - context.TraceInformation("Ignoring diagnostics request because no text document was provided"); + context.TraceDebug("Ignoring diagnostics request because no text document was provided"); return new([]); } diff --git a/src/LanguageServer/Protocol/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs b/src/LanguageServer/Protocol/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs index 315ad96903107..33ce7c29a33fc 100644 --- a/src/LanguageServer/Protocol/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs +++ b/src/LanguageServer/Protocol/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs @@ -107,7 +107,7 @@ protected virtual Task WaitForChangesAsync(string? category, RequestContext cont // noise. It is not exposed to the user. if (!this.GlobalOptions.GetOption(SolutionCrawlerRegistrationService.EnableSolutionCrawler)) { - context.TraceInformation($"{this.GetType()}. Skipping due to {nameof(SolutionCrawlerRegistrationService.EnableSolutionCrawler)}={false}"); + context.TraceDebug($"{this.GetType()}. Skipping due to {nameof(SolutionCrawlerRegistrationService.EnableSolutionCrawler)}={false}"); } else { @@ -116,7 +116,7 @@ protected virtual Task WaitForChangesAsync(string? category, RequestContext cont var clientCapabilities = context.GetRequiredClientCapabilities(); var category = GetRequestDiagnosticCategory(diagnosticsParams); var handlerName = $"{this.GetType().Name}(category: {category})"; - context.TraceInformation($"{handlerName} started getting diagnostics"); + context.TraceDebug($"{handlerName} started getting diagnostics"); var versionedCache = _categoryToVersionedCache.GetOrAdd( handlerName, static (handlerName, globalOptions) => new(globalOptions, handlerName), GlobalOptions); @@ -124,7 +124,7 @@ protected virtual Task WaitForChangesAsync(string? category, RequestContext cont // Get the set of results the request said were previously reported. We can use this to determine both // what to skip, and what files we have to tell the client have been removed. var previousResults = GetPreviousResults(diagnosticsParams) ?? []; - context.TraceInformation($"previousResults.Length={previousResults.Length}"); + context.TraceDebug($"previousResults.Length={previousResults.Length}"); // Create a mapping from documents to the previous results the client says it has for them. That way as we // process documents we know if we should tell the client it should stay the same, or we can tell it what @@ -142,7 +142,7 @@ protected virtual Task WaitForChangesAsync(string? category, RequestContext cont var orderedSources = await GetOrderedDiagnosticSourcesAsync( diagnosticsParams, category, context, cancellationToken).ConfigureAwait(false); - context.TraceInformation($"Processing {orderedSources.Length} documents"); + context.TraceDebug($"Processing {orderedSources.Length} documents"); // Keep track of what diagnostic sources we see this time around. For any we do not see this time // around, we'll notify the client that the diagnostics for it have been removed. @@ -169,7 +169,7 @@ protected virtual Task WaitForChangesAsync(string? category, RequestContext cont } else { - context.TraceInformation($"Diagnostics were unchanged for {diagnosticSource.ToDisplayString()}"); + context.TraceDebug($"Diagnostics were unchanged for {diagnosticSource.ToDisplayString()}"); // Nothing changed between the last request and this one. Report a (null-diagnostics, // same-result-id) response to the client as that means they should just preserve the current @@ -212,7 +212,7 @@ protected virtual Task WaitForChangesAsync(string? category, RequestContext cont // If we had a progress object, then we will have been reporting to that. Otherwise, take what we've been // collecting and return that. - context.TraceInformation($"{this.GetType()} finished getting diagnostics"); + context.TraceDebug($"{this.GetType()} finished getting diagnostics"); } return CreateReturn(progress); @@ -297,7 +297,7 @@ private void HandleRemovedDocuments(RequestContext context, HashSet> ComputeDataAsync(DiagnosticsRequestState state, CancellationToken cancellationToken) { var diagnostics = await state.DiagnosticSource.GetDiagnosticsAsync(state.Context, cancellationToken).ConfigureAwait(false); - state.Context.TraceInformation($"Found {diagnostics.Length} diagnostics for {state.DiagnosticSource.ToDisplayString()}"); + state.Context.TraceDebug($"Found {diagnostics.Length} diagnostics for {state.DiagnosticSource.ToDisplayString()}"); return diagnostics; } diff --git a/src/LanguageServer/Protocol/Handler/DocumentChanges/DidCloseHandler.cs b/src/LanguageServer/Protocol/Handler/DocumentChanges/DidCloseHandler.cs index e095e7aeaab5c..2f8d5aa6cfb5e 100644 --- a/src/LanguageServer/Protocol/Handler/DocumentChanges/DidCloseHandler.cs +++ b/src/LanguageServer/Protocol/Handler/DocumentChanges/DidCloseHandler.cs @@ -31,7 +31,7 @@ public DidCloseHandler() public async Task HandleNotificationAsync(LSP.DidCloseTextDocumentParams request, RequestContext context, CancellationToken cancellationToken) { // GetTextDocumentIdentifier returns null to avoid creating the solution, so the queue is not able to log the uri. - context.TraceInformation($"didClose for {request.TextDocument.DocumentUri}"); + context.TraceDebug($"didClose for {request.TextDocument.DocumentUri}"); await context.StopTrackingAsync(request.TextDocument.DocumentUri, cancellationToken).ConfigureAwait(false); } diff --git a/src/LanguageServer/Protocol/Handler/DocumentChanges/DidOpenHandler.cs b/src/LanguageServer/Protocol/Handler/DocumentChanges/DidOpenHandler.cs index eb6f36942b79a..72e09446527fc 100644 --- a/src/LanguageServer/Protocol/Handler/DocumentChanges/DidOpenHandler.cs +++ b/src/LanguageServer/Protocol/Handler/DocumentChanges/DidOpenHandler.cs @@ -32,7 +32,7 @@ public DidOpenHandler() public async Task HandleNotificationAsync(LSP.DidOpenTextDocumentParams request, RequestContext context, CancellationToken cancellationToken) { // GetTextDocumentIdentifier returns null to avoid creating the solution, so the queue is not able to log the uri. - context.TraceInformation($"didOpen for {request.TextDocument.DocumentUri}"); + context.TraceDebug($"didOpen for {request.TextDocument.DocumentUri}"); // Add the document and ensure the text we have matches whats on the client // TODO (https://github.com/dotnet/roslyn/issues/63583): diff --git a/src/LanguageServer/Protocol/Handler/InlineCompletions/XmlSnippetParser.cs b/src/LanguageServer/Protocol/Handler/InlineCompletions/XmlSnippetParser.cs index a866a357c7485..0ca5cd43d7e89 100644 --- a/src/LanguageServer/Protocol/Handler/InlineCompletions/XmlSnippetParser.cs +++ b/src/LanguageServer/Protocol/Handler/InlineCompletions/XmlSnippetParser.cs @@ -47,7 +47,7 @@ public XmlSnippetParser() ParsedXmlSnippet? parsedSnippet = null; try { - logger.LogInformation($"Reading snippet for {matchingSnippetInfo.Title} with path {matchingSnippetInfo.Path}"); + logger.LogDebug($"Reading snippet for {matchingSnippetInfo.Title} with path {matchingSnippetInfo.Path}"); parsedSnippet = GetAndParseSnippetFromFile(matchingSnippetInfo); } catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.General)) diff --git a/src/LanguageServer/Protocol/Handler/MapCode/MapCodeHandler.cs b/src/LanguageServer/Protocol/Handler/MapCode/MapCodeHandler.cs index eda5bf4dd5a52..3d941086b7c07 100644 --- a/src/LanguageServer/Protocol/Handler/MapCode/MapCodeHandler.cs +++ b/src/LanguageServer/Protocol/Handler/MapCode/MapCodeHandler.cs @@ -102,7 +102,7 @@ public MapCodeHandler() if (textChanges is null) { - context.TraceInformation($"mapCode sub-request for {textDocument.DocumentUri} failed: 'IMapCodeService.MapCodeAsync' returns null."); + context.TraceDebug($"mapCode sub-request for {textDocument.DocumentUri} failed: 'IMapCodeService.MapCodeAsync' returns null."); return null; } @@ -127,7 +127,7 @@ public MapCodeHandler() // Ignore anything not in target document, which current code mapper doesn't handle anyway if (!location.DocumentUri.Equals(textDocumentIdentifier.DocumentUri)) { - context.TraceInformation($"A focus location in '{textDocumentIdentifier.DocumentUri}' is skipped, only locations in corresponding MapCodeMapping.TextDocument is currently considered."); + context.TraceDebug($"A focus location in '{textDocumentIdentifier.DocumentUri}' is skipped, only locations in corresponding MapCodeMapping.TextDocument is currently considered."); continue; } diff --git a/src/LanguageServer/Protocol/Handler/RelatedDocuments/RelatedDocumentsHandler.cs b/src/LanguageServer/Protocol/Handler/RelatedDocuments/RelatedDocumentsHandler.cs index 513be4762d6fc..875655305f4c0 100644 --- a/src/LanguageServer/Protocol/Handler/RelatedDocuments/RelatedDocumentsHandler.cs +++ b/src/LanguageServer/Protocol/Handler/RelatedDocuments/RelatedDocumentsHandler.cs @@ -41,19 +41,17 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalRelatedDocumen public async Task HandleRequestAsync( VSInternalRelatedDocumentParams requestParams, RequestContext context, CancellationToken cancellationToken) { - context.TraceInformation($"{this.GetType()} started getting related documents"); - var solution = context.Solution; var document = context.Document; Contract.ThrowIfNull(solution); Contract.ThrowIfNull(document); - context.TraceInformation($"Processing: {document.FilePath}"); + context.TraceDebug($"Processing: {document.FilePath}"); var relatedDocumentsService = document.GetLanguageService(); if (relatedDocumentsService == null) { - context.TraceInformation($"Ignoring document '{document.FilePath}' because it does not support related documents"); + context.TraceDebug($"Ignoring document '{document.FilePath}' because it does not support related documents"); return []; } @@ -85,7 +83,6 @@ await relatedDocumentsService.GetRelatedDocumentIdsAsync( // If we had a progress object, then we will have been reporting to that. Otherwise, take what we've been // collecting and return that. - context.TraceInformation($"{this.GetType()} finished getting related documents"); return progress.GetFlattenedValues(); } } diff --git a/src/LanguageServer/Protocol/Handler/RequestContext.cs b/src/LanguageServer/Protocol/Handler/RequestContext.cs index 146bbed5444fa..59f2e94a7c2b4 100644 --- a/src/LanguageServer/Protocol/Handler/RequestContext.cs +++ b/src/LanguageServer/Protocol/Handler/RequestContext.cs @@ -330,13 +330,13 @@ public SourceText GetTrackedDocumentSourceText(DocumentUri documentUri) // handler treats those as separate worlds that they are responsible for. if (TextDocument is not TDocument document) { - TraceInformation($"Ignoring diagnostics request because no {typeof(TDocument).Name} was provided"); + TraceDebug($"Ignoring diagnostics request because no {typeof(TDocument).Name} was provided"); return null; } if (!IsTracking(document.GetURI())) { - TraceWarning($"Ignoring diagnostics request for untracked document: {document.GetURI()}"); + TraceDebug($"Ignoring diagnostics request for untracked document: {document.GetURI()}"); return null; } @@ -361,6 +361,9 @@ public void ClearSolutionContext() _lspSolution.Value = default; } + public void TraceDebug(string message) + => _logger.LogDebug(message); + /// /// Logs an informational message. /// diff --git a/src/LanguageServer/Protocol/Handler/SpellCheck/AbstractSpellCheckingHandler.cs b/src/LanguageServer/Protocol/Handler/SpellCheck/AbstractSpellCheckingHandler.cs index dc7f44fd9b056..a27b547c97355 100644 --- a/src/LanguageServer/Protocol/Handler/SpellCheck/AbstractSpellCheckingHandler.cs +++ b/src/LanguageServer/Protocol/Handler/SpellCheck/AbstractSpellCheckingHandler.cs @@ -62,7 +62,7 @@ protected AbstractSpellCheckHandler() public async Task HandleRequestAsync( TParams requestParams, RequestContext context, CancellationToken cancellationToken) { - context.TraceInformation($"{this.GetType()} started getting spell checking spans"); + context.TraceDebug($"{this.GetType()} started getting spell checking spans"); // The progress object we will stream reports to. using var progress = BufferedProgress.Create(requestParams.PartialResultToken); @@ -70,7 +70,7 @@ protected AbstractSpellCheckHandler() // Get the set of results the request said were previously reported. We can use this to determine both // what to skip, and what files we have to tell the client have been removed. var previousResults = GetPreviousResults(requestParams) ?? []; - context.TraceInformation($"previousResults.Length={previousResults.Length}"); + context.TraceDebug($"previousResults.Length={previousResults.Length}"); // First, let the client know if any workspace documents have gone away. That way it can remove those for // the user from squiggles or error-list. @@ -84,16 +84,16 @@ protected AbstractSpellCheckHandler() // Next process each file in priority order. Determine if spans are changed or unchanged since the // last time we notified the client. Report back either to the client so they can update accordingly. var orderedDocuments = GetOrderedDocuments(context, cancellationToken); - context.TraceInformation($"Processing {orderedDocuments.Length} documents"); + context.TraceDebug($"Processing {orderedDocuments.Length} documents"); foreach (var document in orderedDocuments) { - context.TraceInformation($"Processing: {document.FilePath}"); + context.TraceDebug($"Processing: {document.FilePath}"); var languageService = document.GetLanguageService(); if (languageService == null) { - context.TraceInformation($"Ignoring document '{document.FilePath}' because it does not support spell checking"); + context.TraceDebug($"Ignoring document '{document.FilePath}' because it does not support spell checking"); continue; } @@ -107,7 +107,7 @@ protected AbstractSpellCheckHandler() if (newResult != null) { var (newResultId, spans) = newResult.Value; - context.TraceInformation($"Spans were changed for document: {document.FilePath}"); + context.TraceDebug($"Spans were changed for document: {document.FilePath}"); foreach (var report in ReportCurrentSpans( document, spans, newResultId)) { @@ -116,7 +116,7 @@ protected AbstractSpellCheckHandler() } else { - context.TraceInformation($"Spans were unchanged for document: {document.FilePath}"); + context.TraceDebug($"Spans were unchanged for document: {document.FilePath}"); // Nothing changed between the last request and this one. Report a (null-spans, same-result-id) // response to the client as that means they should just preserve the current spans they have for @@ -128,7 +128,7 @@ protected AbstractSpellCheckHandler() // If we had a progress object, then we will have been reporting to that. Otherwise, take what we've been // collecting and return that. - context.TraceInformation($"{this.GetType()} finished getting spans"); + context.TraceDebug($"{this.GetType()} finished getting spans"); return progress.GetFlattenedValues(); } @@ -212,7 +212,7 @@ private async Task HandleRemovedDocumentsAsync( var document = await context.Solution.GetTextDocumentAsync(textDocument, cancellationToken).ConfigureAwait(false); if (document == null) { - context.TraceInformation($"Clearing spans for removed document: {textDocument.DocumentUri}"); + context.TraceDebug($"Clearing spans for removed document: {textDocument.DocumentUri}"); // Client is asking server about a document that no longer exists (i.e. was removed/deleted from // the workspace). Report a (null-spans, null-result-id) response to the client as that means diff --git a/src/LanguageServer/Protocol/Handler/SpellCheck/DocumentSpellCheckHandler.cs b/src/LanguageServer/Protocol/Handler/SpellCheck/DocumentSpellCheckHandler.cs index 318fc1a019125..a2d6479cbc9ed 100644 --- a/src/LanguageServer/Protocol/Handler/SpellCheck/DocumentSpellCheckHandler.cs +++ b/src/LanguageServer/Protocol/Handler/SpellCheck/DocumentSpellCheckHandler.cs @@ -47,13 +47,13 @@ internal static ImmutableArray GetRequestedDocument(RequestContext con // handler treats those as separate worlds that they are responsible for. if (context.Document == null) { - context.TraceInformation("Ignoring spell check request because no document was provided"); + context.TraceDebug("Ignoring spell check request because no document was provided"); return []; } if (!context.IsTracking(context.Document.GetURI())) { - context.TraceInformation($"Ignoring spell check request for untracked document: {context.Document.GetURI()}"); + context.TraceDebug($"Ignoring spell check request for untracked document: {context.Document.GetURI()}"); return []; } diff --git a/src/LanguageServer/Protocol/Handler/SpellCheck/WorkspaceSpellCheckHandler.cs b/src/LanguageServer/Protocol/Handler/SpellCheck/WorkspaceSpellCheckHandler.cs index ad36a4f6b58d6..a3233c7bcac9d 100644 --- a/src/LanguageServer/Protocol/Handler/SpellCheck/WorkspaceSpellCheckHandler.cs +++ b/src/LanguageServer/Protocol/Handler/SpellCheck/WorkspaceSpellCheckHandler.cs @@ -79,7 +79,7 @@ void AddDocumentsFromProject(Project? project, ImmutableArray supportedL // Each handler treats those as separate worlds that they are responsible for. if (context.IsTracking(document.GetURI())) { - context.TraceInformation($"Skipping tracked document: {document.GetURI()}"); + context.TraceDebug($"Skipping tracked document: {document.GetURI()}"); continue; } diff --git a/src/LanguageServer/Protocol/RoslynLanguageServer.cs b/src/LanguageServer/Protocol/RoslynLanguageServer.cs index 134cbc66ba349..ca575808b15f9 100644 --- a/src/LanguageServer/Protocol/RoslynLanguageServer.cs +++ b/src/LanguageServer/Protocol/RoslynLanguageServer.cs @@ -167,7 +167,7 @@ public override bool TryGetLanguageForRequest(string methodName, object? seriali { if (serializedParameters == null) { - Logger.LogInformation("No request parameters given, using default language handler"); + Logger.LogDebug("No request parameters given, using default language handler"); language = LanguageServerConstants.DefaultLanguageName; return true; } @@ -212,7 +212,7 @@ public override bool TryGetLanguageForRequest(string methodName, object? seriali if (uri == null) { // This request is not for a textDocument and is not a resolve request. - Logger.LogInformation("Request did not contain a textDocument, using default language handler"); + Logger.LogDebug("Request did not contain a textDocument, using default language handler"); language = LanguageServerConstants.DefaultLanguageName; return true; } diff --git a/src/LanguageServer/Protocol/Workspaces/LspWorkspaceManager.cs b/src/LanguageServer/Protocol/Workspaces/LspWorkspaceManager.cs index 2201573441f12..281ad35c95c31 100644 --- a/src/LanguageServer/Protocol/Workspaces/LspWorkspaceManager.cs +++ b/src/LanguageServer/Protocol/Workspaces/LspWorkspaceManager.cs @@ -247,7 +247,7 @@ public void UpdateTrackedDocument(DocumentUri uri, SourceText newSourceText) var workspaceKind = document.Project.Solution.WorkspaceKind; _requestTelemetryLogger.UpdateFindDocumentTelemetryData(success: true, workspaceKind); _requestTelemetryLogger.UpdateUsedForkedSolutionCounter(isForked); - _logger.LogInformation($"{document.FilePath} found in workspace {workspaceKind}"); + _logger.LogDebug($"{document.FilePath} found in workspace {workspaceKind}"); // As we found the document in a non-misc workspace, also attempt to remove it from the misc workspace // if it happens to be in there as well. @@ -264,7 +264,7 @@ public void UpdateTrackedDocument(DocumentUri uri, SourceText newSourceText) // We didn't find the document in any workspace, record a telemetry notification that we did not find it. // Depending on the host, this can be entirely normal (e.g. opening a loose file) var searchedWorkspaceKinds = string.Join(";", lspSolutions.SelectAsArray(lspSolution => lspSolution.Solution.Workspace.Kind)); - _logger.LogInformation($"Could not find '{textDocumentIdentifier.DocumentUri}'. Searched {searchedWorkspaceKinds}"); + _logger.LogDebug($"Could not find '{textDocumentIdentifier.DocumentUri}'. Searched {searchedWorkspaceKinds}"); _requestTelemetryLogger.UpdateFindDocumentTelemetryData(success: false, workspaceKind: null); // Add the document to our loose files workspace (if we have one) if it is open. diff --git a/src/VisualStudio/Core/Def/LanguageClient/VisualStudioLogHubLoggerFactory.cs b/src/VisualStudio/Core/Def/LanguageClient/VisualStudioLogHubLoggerFactory.cs index eb8939054bb8f..f03df5367271e 100644 --- a/src/VisualStudio/Core/Def/LanguageClient/VisualStudioLogHubLoggerFactory.cs +++ b/src/VisualStudio/Core/Def/LanguageClient/VisualStudioLogHubLoggerFactory.cs @@ -50,7 +50,7 @@ public async Task CreateLoggerAsync(string serverTypeName, Js // Register the default log level as information. // Loghub will take care of cleaning up older logs from past sessions / current session // if it decides the log file sizes are too large. - var loggingLevel = SourceLevels.ActivityTracing | SourceLevels.Information; + var loggingLevel = SourceLevels.ActivityTracing | SourceLevels.Verbose; var logOptions = new RpcContracts.Logging.LoggerOptions(new LoggingLevelSettings(loggingLevel)); var traceSource = await configuration.RegisterLogSourceAsync(logId, logOptions, cancellationToken).ConfigureAwait(false);