Skip to content

Commit 8404703

Browse files
committed
Adjust log levels to match expectations
1 parent b8694df commit 8404703

14 files changed

+74
-63
lines changed

src/lsptoolshost/razor/htmlDocumentContentProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class HtmlDocumentContentProvider implements vscode.TextDocumentContentPr
2828
if (!document) {
2929
// Document was removed from the document manager, meaning there's no more content for this
3030
// file. Report an empty document.
31-
this.logger.logVerbose(
31+
this.logger.logTrace(
3232
`Could not find document '${getUriPath(
3333
uri
3434
)}' when updating the HTML buffer. This typically happens when a document is removed.`

src/lsptoolshost/razor/htmlDocumentManager.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export class HtmlDocumentManager {
2727
const didCloseRegistration = vscode.workspace.onDidCloseTextDocument(async (document) => {
2828
// We log when a virtual document is closed just in case it helps track down future bugs
2929
if (document.uri.scheme === HtmlDocumentContentProvider.scheme) {
30-
this.logger.logVerbose(`Virtual document '${document.uri}' timed out.`);
30+
this.logger.logTrace(`Virtual document '${document.uri}' timed out.`);
3131
return;
3232
}
3333

3434
// When a Razor document is closed, only then can we be sure its okay to remove the virtual document.
3535
if (document.languageId === 'aspnetcorerazor') {
36-
this.logger.logVerbose(`Document '${document.uri}' was closed.`);
36+
this.logger.logTrace(`Document '${document.uri}' was closed.`);
3737

3838
await this.closeDocument(document.uri);
3939

@@ -52,7 +52,7 @@ export class HtmlDocumentManager {
5252
public async updateDocumentText(uri: vscode.Uri, text: string) {
5353
const document = await this.getDocument(uri);
5454

55-
this.logger.logVerbose(`New content for '${uri}', updating '${document.path}'.`);
55+
this.logger.logTrace(`New content for '${uri}', updating '${document.path}'.`);
5656

5757
document.setContent(text);
5858

@@ -63,7 +63,7 @@ export class HtmlDocumentManager {
6363
const document = await this.findDocument(uri);
6464

6565
if (document) {
66-
this.logger.logVerbose(`Removing '${document.uri}' from the document manager.`);
66+
this.logger.logTrace(`Removing '${document.uri}' from the document manager.`);
6767

6868
delete this.htmlDocuments[document.path];
6969
}
@@ -74,7 +74,7 @@ export class HtmlDocumentManager {
7474

7575
// This might happen in the case that a file is opened outside the workspace
7676
if (!document) {
77-
this.logger.logMessage(
77+
this.logger.logInfo(
7878
`File '${uri}' didn't exist in the Razor document list. This is likely because it's from outside the workspace.`
7979
);
8080
document = this.addDocument(uri);
@@ -88,7 +88,7 @@ export class HtmlDocumentManager {
8888
private addDocument(uri: vscode.Uri): HtmlDocument {
8989
let document = this.findDocument(uri);
9090
if (document) {
91-
this.logger.logMessage(`Skipping document creation for '${document.path}' because it already exists.`);
91+
this.logger.logInfo(`Skipping document creation for '${document.path}' because it already exists.`);
9292
return document;
9393
}
9494

src/razor/src/blazorDebug/terminateDebugHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const killProcess = (targetPid: number | undefined, logger: RazorLogger) => {
2121
}
2222

2323
try {
24-
logger.logVerbose(`[DEBUGGER] Terminating debugging session with PID ${targetPid}...`);
24+
logger.logTrace(`[DEBUGGER] Terminating debugging session with PID ${targetPid}...`);
2525
process.kill(targetPid);
2626
} catch (error) {
2727
logger.logError(`[DEBUGGER] Error terminating debug processes with PID ${targetPid}: `, error as Error);

src/razor/src/csharp/csharpProjectedDocumentContentProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export class CSharpProjectedDocumentContentProvider implements vscode.TextDocume
3535
// Document was removed from the document manager, meaning there's no more content for this
3636
// file. Report an empty document.
3737

38-
if (this.logger.verboseEnabled) {
39-
this.logger.logVerbose(
38+
if (this.logger.traceEnabled) {
39+
this.logger.logTrace(
4040
`Could not find document '${getUriPath(
4141
uri
4242
)}' when updating the C# buffer. This typically happens when a document is removed.`

src/razor/src/document/razorDocumentManager.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
148148

149149
// This might happen in the case that a file is opened outside the workspace
150150
if (!document) {
151-
this.logger.logMessage(
151+
this.logger.logInfo(
152152
`File '${path}' didn't exist in the Razor document list. This is likely because it's from outside the workspace.`
153153
);
154154
document = this.addDocument(uri);
@@ -204,7 +204,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
204204
const path = getUriPath(uri);
205205
let document = this.findDocument(path);
206206
if (document) {
207-
this.logger.logMessage(`Skipping document creation for '${path}' because it already exists.`);
207+
this.logger.logInfo(`Skipping document creation for '${path}' because it already exists.`);
208208
return document;
209209
}
210210

@@ -238,8 +238,8 @@ export class RazorDocumentManager implements IRazorDocumentManager {
238238
}
239239

240240
private async updateCSharpBuffer(updateBufferRequest: UpdateBufferRequest) {
241-
if (this.logger.verboseEnabled) {
242-
this.logger.logVerbose(
241+
if (this.logger.traceEnabled) {
242+
this.logger.logTrace(
243243
`Updating the C# document for Razor file '${updateBufferRequest.hostDocumentFilePath}' ` +
244244
`(${updateBufferRequest.hostDocumentVersion})`
245245
);
@@ -284,8 +284,8 @@ export class RazorDocumentManager implements IRazorDocumentManager {
284284
}
285285

286286
private async updateHtmlBuffer(updateBufferRequest: UpdateBufferRequest) {
287-
if (this.logger.verboseEnabled) {
288-
this.logger.logVerbose(
287+
if (this.logger.traceEnabled) {
288+
this.logger.logTrace(
289289
`Updating the HTML document for Razor file '${updateBufferRequest.hostDocumentFilePath}' ` +
290290
`(${updateBufferRequest.hostDocumentVersion})`
291291
);
@@ -327,8 +327,8 @@ export class RazorDocumentManager implements IRazorDocumentManager {
327327
}
328328

329329
private notifyDocumentChange(document: IRazorDocument, kind: RazorDocumentChangeKind, changes: ServerTextChange[]) {
330-
if (this.logger.verboseEnabled) {
331-
this.logger.logVerbose(
330+
if (this.logger.traceEnabled) {
331+
this.logger.logTrace(
332332
`Notifying document '${getUriPath(document.uri)}' changed '${RazorDocumentChangeKind[kind]}' with '${
333333
changes.length
334334
}' changes.`

src/razor/src/document/razorDocumentSynchronizer.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export class RazorDocumentSynchronizer {
3737
const logId = ++this.synchronizationIdentifier;
3838

3939
const documentKey = getUriPath(projectedDocument.uri);
40-
if (this.logger.verboseEnabled) {
40+
if (this.logger.traceEnabled) {
4141
const ehdv = expectedHostDocumentVersion;
42-
this.logger.logVerbose(
42+
this.logger.logTrace(
4343
`${logId} - Synchronizing '${documentKey}':
4444
Currently at ${projectedDocument.hostDocumentSyncVersion}, synchronizing to version '${ehdv}'.'`
4545
);
@@ -55,52 +55,52 @@ export class RazorDocumentSynchronizer {
5555

5656
try {
5757
if (projectedDocument.hostDocumentSyncVersion !== expectedHostDocumentVersion) {
58-
if (this.logger.verboseEnabled) {
59-
this.logger.logVerbose(
58+
if (this.logger.traceEnabled) {
59+
this.logger.logTrace(
6060
`${logId} - Projected document not in sync with host document, waiting for update...
6161
Current host document sync version: ${projectedDocument.hostDocumentSyncVersion}`
6262
);
6363
}
6464
await context.onProjectedDocumentSynchronized;
6565
}
6666

67-
if (this.logger.verboseEnabled) {
68-
this.logger.logVerbose(`${logId} - Projected document in sync with host document`);
67+
if (this.logger.traceEnabled) {
68+
this.logger.logTrace(`${logId} - Projected document in sync with host document`);
6969
}
7070

7171
// Projected document is the one we expect.
7272

7373
const projectedTextDocument = await vscode.workspace.openTextDocument(projectedDocument.uri);
7474
const projectedTextDocumentVersion = this.getProjectedTextDocumentVersion(projectedTextDocument);
7575
if (projectedDocument.hostDocumentSyncVersion !== projectedTextDocumentVersion) {
76-
if (this.logger.verboseEnabled) {
77-
this.logger.logVerbose(
76+
if (this.logger.traceEnabled) {
77+
this.logger.logTrace(
7878
`${logId} - Projected text document not in sync with data type, waiting for update...
7979
Current projected text document sync version: ${projectedTextDocumentVersion}`
8080
);
8181
}
8282
await context.onProjectedTextDocumentSynchronized;
8383
}
8484

85-
if (this.logger.verboseEnabled) {
86-
this.logger.logVerbose(`${logId} - Projected text document in sync with data type`);
85+
if (this.logger.traceEnabled) {
86+
this.logger.logTrace(`${logId} - Projected text document in sync with data type`);
8787
}
8888

8989
// Projected text document is the one we expect
9090
} catch (cancellationReason) {
9191
this.removeSynchronization(context);
9292

93-
if (this.logger.verboseEnabled) {
94-
this.logger.logVerbose(`${logId} - Synchronization failed: ${cancellationReason}`);
93+
if (this.logger.traceEnabled) {
94+
this.logger.logTrace(`${logId} - Synchronization failed: ${cancellationReason}`);
9595
}
9696

9797
return false;
9898
}
9999

100100
this.removeSynchronization(context);
101101

102-
if (this.logger.verboseEnabled) {
103-
this.logger.logVerbose(`${logId} - Synchronization successful!`);
102+
if (this.logger.traceEnabled) {
103+
this.logger.logTrace(`${logId} - Synchronization successful!`);
104104
}
105105

106106
return true;
@@ -198,10 +198,10 @@ export class RazorDocumentSynchronizer {
198198

199199
for (const context of synchronizationContexts) {
200200
if (context.projectedDocument.hostDocumentSyncVersion === projectedTextDocumentVersion) {
201-
if (this.logger.verboseEnabled) {
201+
if (this.logger.traceEnabled) {
202202
const li = context.logIdentifier;
203203
const ptdv = projectedTextDocumentVersion;
204-
this.logger.logVerbose(`${li} - Projected text document synchronized to ${ptdv}.`);
204+
this.logger.logTrace(`${li} - Projected text document synchronized to ${ptdv}.`);
205205
}
206206
context.projectedTextDocumentSynchronized();
207207
}

src/razor/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function activate(
8181
// TODO: We still need a document manager for Html, so need to do _some_ of the below, just not sure what yet,
8282
// and it needs to be able to take a roslynLanguageServerClient instead of a razorLanguageServerClient I guess.
8383

84-
logger.logVerbose(
84+
logger.logTrace(
8585
'Razor cohosting is enabled, skipping language server activation. No rzls process will be created.'
8686
);
8787

src/razor/src/html/htmlProjectedDocumentContentProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export class HtmlProjectedDocumentContentProvider implements vscode.TextDocument
3535
// Document was removed from the document manager, meaning there's no more content for this
3636
// file. Report an empty document.
3737

38-
if (this.logger.verboseEnabled) {
39-
this.logger.logVerbose(
38+
if (this.logger.traceEnabled) {
39+
this.logger.logTrace(
4040
`Could not find document '${getUriPath(
4141
uri
4242
)}' when updating the HTML buffer. This typically happens when a document is removed.`

src/razor/src/mapping/mappingHelpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class MappingHelpers {
7979
} else {
8080
const remappedEdit = new vscode.TextEdit(remappedResponse.ranges[0], textEdit.newText);
8181

82-
logger.logVerbose(
82+
logger.logTrace(
8383
`Re-mapping text ${textEdit.newText} at ${textEdit.range} in ${uri.path} to ${remappedResponse.ranges[0]} in ${uri.path}`
8484
);
8585

@@ -112,7 +112,7 @@ export class MappingHelpers {
112112
return;
113113
}
114114

115-
logger.logVerbose(
115+
logger.logTrace(
116116
`Re-mapping location ${location.range} in ${location.uri.path} to ${remappedResponse.ranges[0]} in ${documentUri.path}`
117117
);
118118

src/razor/src/razorCSharpLanguageMiddleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class RazorCSharpLanguageMiddleware implements LanguageMiddleware {
6565
} else {
6666
const remappedEdit = new vscode.TextEdit(remappedResponse.ranges[0], edit.newText);
6767

68-
this.logger.logVerbose(
68+
this.logger.logTrace(
6969
`Re-mapping text ${edit.newText} at ${edit.range} in ${uri.path} to ${remappedResponse.ranges[0]} in ${documentUri.path}`
7070
);
7171

@@ -105,7 +105,7 @@ export class RazorCSharpLanguageMiddleware implements LanguageMiddleware {
105105
const newLocation = new vscode.Location(documentUri, remappedResponse.ranges[0]);
106106
result.push(newLocation);
107107

108-
this.logger.logVerbose(
108+
this.logger.logTrace(
109109
`Re-mapping location ${location.range} in ${location.uri.path} to ${remappedResponse.ranges[0]} in ${documentUri.path}`
110110
);
111111
}

0 commit comments

Comments
 (0)