-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix information logs getting logged as debug in VSCode #78522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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,15 +116,15 @@ 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); | ||
|
|
||
| // 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}"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really related to this, but whenever I saw this in the logs it was very unclear what this was related to. Not sure if it should also be prefixed with handlerName or something.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| // 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<PreviousPull | |
| { | ||
| foreach (var removedResult in removedPreviousResults) | ||
| { | ||
| context.TraceInformation($"Clearing diagnostics for removed document: {removedResult.TextDocument.DocumentUri}"); | ||
| context.TraceDebug($"Clearing diagnostics for removed document: {removedResult.TextDocument.DocumentUri}"); | ||
|
|
||
| // Client is asking server about a document that no longer exists (i.e. was removed/deleted from | ||
| // the workspace). Report a (null-diagnostics, null-result-id) response to the client as that | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were previously downgrading all info logs to debug in vscode because information logs were too verbose. That was because originally the lowest LSP logger level was info, and we ended up logging everything as info.
this fixes it by logging info as info, and adjusting the usages of info logging to a more appropriate level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thank you for finally fixing this!