diff --git a/CHANGELOG.md b/CHANGELOG.md
index f856c41f4..eeaa7885f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@
- Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876)
# 2.58.x
+* Update Razor to 9.0.0-preview.24569.4 (PR: [#7805](https://github.com/dotnet/vscode-csharp/pull/7805))
+ * Allow logging level to be changed in rzls (#11228) (PR: [#11228](https://github.com/dotnet/razor/pull/11228))
+ * [Fuse] bind-Value:attribute support (#11214) (PR: [#11214](https://github.com/dotnet/razor/pull/11214))
+ * Handle skipped trivia in the C# tokenizer (#11207) (PR: [#11207](https://github.com/dotnet/razor/pull/11207))
* Add support for refreshing opened source generated files (PR: [#7791](https://github.com/dotnet/vscode-csharp/pull/7791))
* Update Roslyn to 4.13.0-2.24569.1 (PR: [#7791](https://github.com/dotnet/vscode-csharp/pull/7791))
* Support unbound generic types in 'nameof' operator. (PR: [#75368](https://github.com/dotnet/roslyn/pull/75368))
diff --git a/l10n/bundle.l10n.json b/l10n/bundle.l10n.json
index eea581f10..2eb3b52bd 100644
--- a/l10n/bundle.l10n.json
+++ b/l10n/bundle.l10n.json
@@ -63,7 +63,6 @@
"Cannot load Razor language server because the directory was not found: '{0}'": "Cannot load Razor language server because the directory was not found: '{0}'",
"Razor Log": "Razor Log",
"Could not find '{0}' in or above '{1}'.": "Could not find '{0}' in or above '{1}'.",
- "Invalid razor.server.trace setting. Defaulting to '{0}'": "Invalid razor.server.trace setting. Defaulting to '{0}'",
"Could not find Razor Language Server executable '{0}' within directory": "Could not find Razor Language Server executable '{0}' within directory",
"Server failed to start after retrying 5 times.": "Server failed to start after retrying 5 times.",
"Razor Language Server failed to start unexpectedly, please check the 'Razor Log' and report an issue.": "Razor Language Server failed to start unexpectedly, please check the 'Razor Log' and report an issue.",
@@ -72,8 +71,6 @@
"Tried to bind on notification logic while server is not started.": "Tried to bind on notification logic while server is not started.",
"Cannot stop Razor Language Server as it is already stopped.": "Cannot stop Razor Language Server as it is already stopped.",
"Razor Language Server failed to stop correctly, please check the 'Razor Log' and report an issue.": "Razor Language Server failed to stop correctly, please check the 'Razor Log' and report an issue.",
- "Would you like to restart the Razor Language Server to enable the Razor trace configuration change?": "Would you like to restart the Razor Language Server to enable the Razor trace configuration change?",
- "Restart": "Restart",
"Razor HTML Preview": "Razor HTML Preview",
"Unexpected error when attaching to HTML preview window.": "Unexpected error when attaching to HTML preview window.",
"Razor HTML copied to clipboard": "Razor HTML copied to clipboard",
diff --git a/package.json b/package.json
index 0bdf110dc..814c9b6bc 100644
--- a/package.json
+++ b/package.json
@@ -39,7 +39,7 @@
"defaults": {
"roslyn": "4.13.0-2.24569.1",
"omniSharp": "1.39.11",
- "razor": "9.0.0-preview.24565.1",
+ "razor": "9.0.0-preview.24569.4",
"razorOmnisharp": "7.0.0-preview.23363.1",
"xamlTools": "17.13.35513.19"
},
@@ -1505,22 +1505,6 @@
"description": "%configuration.razor.languageServer.debug%",
"order": 90
},
- "razor.server.trace": {
- "scope": "window",
- "type": "string",
- "enum": [
- "Trace",
- "Debug",
- "Information",
- "Warning",
- "Error",
- "Critical",
- "None"
- ],
- "order": 90,
- "default": "Information",
- "description": "%configuration.razor.server.trace%"
- },
"razor.languageServer.forceRuntimeCodeGeneration": {
"type": "boolean",
"scope": "machine-overridable",
diff --git a/src/razor/src/configurationChangeListener.ts b/src/razor/src/configurationChangeListener.ts
deleted file mode 100644
index aae277e6e..000000000
--- a/src/razor/src/configurationChangeListener.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import * as vscode from 'vscode';
-import { RazorLanguageServerClient } from './razorLanguageServerClient';
-import { RazorLogger } from './razorLogger';
-import { ActionOption, showInformationMessage } from '../../shared/observers/utils/showMessage';
-
-export function listenToConfigurationChanges(languageServerClient: RazorLanguageServerClient): vscode.Disposable {
- return vscode.workspace.onDidChangeConfiguration((event) => {
- if (event.affectsConfiguration(RazorLogger.verbositySetting)) {
- razorTraceConfigurationChangeHandler(languageServerClient);
- }
- });
-}
-
-function razorTraceConfigurationChangeHandler(languageServerClient: RazorLanguageServerClient) {
- const promptText: string = vscode.l10n.t(
- 'Would you like to restart the Razor Language Server to enable the Razor trace configuration change?'
- );
- const restartButtonText: ActionOption = {
- title: vscode.l10n.t('Restart'),
- action: async () => {
- await languageServerClient.stop();
- languageServerClient.updateTraceLevel();
- await languageServerClient.start();
- },
- };
- showInformationMessage(vscode, promptText, restartButtonText);
-}
diff --git a/src/razor/src/diagnostics/reportIssuePanel.ts b/src/razor/src/diagnostics/reportIssuePanel.ts
index 83551174a..e839c0ee6 100644
--- a/src/razor/src/diagnostics/reportIssuePanel.ts
+++ b/src/razor/src/diagnostics/reportIssuePanel.ts
@@ -5,7 +5,6 @@
import * as vscode from 'vscode';
import { RazorLogger } from '../razorLogger';
-import { LogLevel } from '../logLevel';
import { ReportIssueCreator } from './reportIssueCreator';
import { ReportIssueDataCollector } from './reportIssueDataCollector';
import { ReportIssueDataCollectorFactory } from './reportIssueDataCollectorFactory';
@@ -105,7 +104,7 @@ export class ReportIssuePanel {
}
});
- this.traceLevelChange = this.logger.onTraceLevelChange(async () => this.update());
+ this.traceLevelChange = this.logger.outputChannel.onDidChangeLogLevel(async () => this.update());
this.panel.onDidDispose(() => {
if (this.traceLevelChange) {
@@ -121,7 +120,7 @@ export class ReportIssuePanel {
}
let panelBodyContent = '';
- if (this.logger.logLevel.valueOf() <= LogLevel.Debug) {
+ if (this.logger.logLevel <= vscode.LogLevel.Debug) {
const startButtonLabel = vscode.l10n.t('Start');
const startButton = ``;
const firstLine = vscode.l10n.t('Press {0}', startButton);
@@ -159,9 +158,9 @@ ${privacyAnchor}
`;
} else {
- const verbositySettingName = `${RazorLogger.verbositySetting}`;
- const currentVerbositySettingValue = `${LogLevel[this.logger.logLevel]}`;
- const neededVerbositySettingValue = `${LogLevel[LogLevel.Debug]}`;
+ const verbositySettingName = `Razor Logging Level`;
+ const currentVerbositySettingValue = `${vscode.LogLevel[this.logger.logLevel]}`;
+ const neededVerbositySettingValue = `${vscode.LogLevel[vscode.LogLevel.Debug]}`;
panelBodyContent =
'
' +
diff --git a/src/razor/src/extension.ts b/src/razor/src/extension.ts
index 5346f4cc0..fe96bbcc8 100644
--- a/src/razor/src/extension.ts
+++ b/src/razor/src/extension.ts
@@ -6,13 +6,11 @@
import * as vscode from 'vscode';
import * as vscodeapi from 'vscode';
import { ExtensionContext } from 'vscode';
-import { BlazorDebugConfigurationProvider } from './blazorDebug/blazorDebugConfigurationProvider';
import { CodeActionsHandler } from './codeActions/codeActionsHandler';
import { CompletionHandler } from './completion/completionHandler';
import { RazorCodeActionRunner } from './codeActions/razorCodeActionRunner';
import { RazorCodeLensProvider } from './codeLens/razorCodeLensProvider';
import { ColorPresentationHandler } from './colorPresentation/colorPresentationHandler';
-import { listenToConfigurationChanges } from './configurationChangeListener';
import { RazorCSharpFeature } from './csharp/razorCSharpFeature';
import { RazorDefinitionProvider } from './definition/razorDefinitionProvider';
import { ReportIssueCommand } from './diagnostics/reportIssueCommand';
@@ -33,7 +31,6 @@ import { ProposedApisFeature } from './proposedApisFeature';
import { RazorLanguage } from './razorLanguage';
import { RazorLanguageConfiguration } from './razorLanguageConfiguration';
import { RazorLanguageServerClient } from './razorLanguageServerClient';
-import { resolveRazorLanguageServerLogLevel } from './razorLanguageServerTraceResolver';
import { RazorLanguageServiceClient } from './razorLanguageServiceClient';
import { RazorLogger } from './razorLogger';
import { RazorReferenceProvider } from './reference/razorReferenceProvider';
@@ -71,14 +68,12 @@ export async function activate(
create: () => new vscode.EventEmitter(),
};
- const languageServerLogLevel = resolveRazorLanguageServerLogLevel(vscodeType);
- const logger = new RazorLogger(eventEmitterFactory, languageServerLogLevel);
+ const logger = new RazorLogger(eventEmitterFactory);
try {
const razorOptions: RazorLanguageServerOptions = resolveRazorLanguageServerOptions(
vscodeType,
languageServerDir,
- languageServerLogLevel,
logger
);
@@ -125,6 +120,7 @@ export async function activate(
razorTelemetryReporter,
platformInfo
);
+
const documentSynchronizer = new RazorDocumentSynchronizer(documentManager, logger);
reportTelemetryForDocuments(documentManager, razorTelemetryReporter);
const languageConfiguration = new RazorLanguageConfiguration();
@@ -269,7 +265,6 @@ export async function activate(
htmlFeature.register(),
documentSynchronizer.register(),
reportIssueCommand.register(),
- listenToConfigurationChanges(languageServerClient),
razorCodeActionRunner.register()
);
@@ -300,9 +295,6 @@ export async function activate(
localRegistrations.length = 0;
});
- const provider = new BlazorDebugConfigurationProvider(logger, vscodeType);
- context.subscriptions.push(vscodeType.debug.registerDebugConfigurationProvider('blazorwasm', provider));
-
languageServerClient.onStarted(async () => {
await documentManager.initialize();
});
diff --git a/src/razor/src/logLevel.ts b/src/razor/src/logLevel.ts
deleted file mode 100644
index 93c0493de..000000000
--- a/src/razor/src/logLevel.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-export enum LogLevel {
- Trace = 0,
- Debug = 1,
- Information = 2,
- Warning = 3,
- Error = 4,
- Critical = 5,
- None = 6,
-}
diff --git a/src/razor/src/razorLanguageServerClient.ts b/src/razor/src/razorLanguageServerClient.ts
index af4295b4c..5944a0ba2 100644
--- a/src/razor/src/razorLanguageServerClient.ts
+++ b/src/razor/src/razorLanguageServerClient.ts
@@ -12,7 +12,6 @@ import { ServerOptions } from 'vscode-languageclient/node';
import { RazorLanguage } from './razorLanguage';
import { RazorLanguageServerOptions } from './razorLanguageServerOptions';
import { resolveRazorLanguageServerOptions } from './razorLanguageServerOptionsResolver';
-import { resolveRazorLanguageServerLogLevel } from './razorLanguageServerTraceResolver';
import { RazorLogger } from './razorLogger';
import { TelemetryReporter as RazorTelemetryReporter } from './telemetryReporter';
import TelemetryReporter from '@vscode/extension-telemetry';
@@ -56,12 +55,6 @@ export class RazorLanguageServerClient implements vscode.Disposable {
return this.client.initializeResult;
}
- public updateTraceLevel() {
- const languageServerLogLevel = resolveRazorLanguageServerLogLevel(this.vscodeType);
- this.setupLanguageServer();
- this.logger.setTraceLevel(languageServerLogLevel);
- }
-
public onStarted(listener: () => Promise) {
this.onStartedListeners.push(listener);
}
@@ -115,6 +108,10 @@ export class RazorLanguageServerClient implements vscode.Disposable {
await this.client.start();
this.logger.logMessage('Server started, waiting for client to be ready...');
this.isStarted = true;
+
+ // Server is ready, hook up so logging changes can be reported
+ this.logger.languageServerClient = this;
+
for (const listener of this.onStartListeners) {
await listener();
}
@@ -123,6 +120,7 @@ export class RazorLanguageServerClient implements vscode.Disposable {
resolve();
this.logger.logMessage('Server ready!');
+
for (const listener of this.onStartedListeners) {
await listener();
}
@@ -230,11 +228,9 @@ export class RazorLanguageServerClient implements vscode.Disposable {
}
private setupLanguageServer() {
- const languageServerTrace = resolveRazorLanguageServerLogLevel(this.vscodeType);
const options: RazorLanguageServerOptions = resolveRazorLanguageServerOptions(
this.vscodeType,
this.languageServerDir,
- languageServerTrace,
this.logger
);
this.clientOptions = {
@@ -247,8 +243,8 @@ export class RazorLanguageServerClient implements vscode.Disposable {
this.logger.logMessage(`Razor language server path: ${options.serverPath}`);
args.push('--logLevel');
- args.push(options.logLevel.toString());
- this.razorTelemetryReporter.reportTraceLevel(options.logLevel);
+ args.push(this.logger.logLevelForRZLS.toString());
+ this.razorTelemetryReporter.reportTraceLevel(this.logger.logLevel);
if (options.debug) {
this.razorTelemetryReporter.reportDebugLanguageServer();
diff --git a/src/razor/src/razorLanguageServerOptions.ts b/src/razor/src/razorLanguageServerOptions.ts
index 0f4df5562..e93802c84 100644
--- a/src/razor/src/razorLanguageServerOptions.ts
+++ b/src/razor/src/razorLanguageServerOptions.ts
@@ -4,13 +4,11 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
-import { LogLevel } from './logLevel';
export interface RazorLanguageServerOptions {
serverPath: string;
outputChannel?: vscode.OutputChannel;
debug?: boolean;
- logLevel: LogLevel;
usingOmniSharp: boolean;
forceRuntimeCodeGeneration: boolean;
useRoslynTokenizer: boolean;
diff --git a/src/razor/src/razorLanguageServerOptionsResolver.ts b/src/razor/src/razorLanguageServerOptionsResolver.ts
index 4bb395ca5..977741f42 100644
--- a/src/razor/src/razorLanguageServerOptionsResolver.ts
+++ b/src/razor/src/razorLanguageServerOptionsResolver.ts
@@ -10,13 +10,11 @@ import * as vscodeAdapter from './vscodeAdapter';
import * as vscode from 'vscode';
import { RazorLanguageServerOptions } from './razorLanguageServerOptions';
import { RazorLogger } from './razorLogger';
-import { LogLevel } from './logLevel';
import { getCSharpDevKit } from '../../utils/getCSharpDevKit';
export function resolveRazorLanguageServerOptions(
vscodeApi: vscodeAdapter.api,
languageServerDir: string,
- logLevel: LogLevel,
logger: RazorLogger
) {
const languageServerExecutablePath = findLanguageServerExecutable(languageServerDir);
@@ -31,7 +29,6 @@ export function resolveRazorLanguageServerOptions(
return {
serverPath: languageServerExecutablePath,
debug: debugLanguageServer,
- logLevel: logLevel,
outputChannel: logger.outputChannel,
usingOmniSharp,
forceRuntimeCodeGeneration,
diff --git a/src/razor/src/razorLanguageServerTraceResolver.ts b/src/razor/src/razorLanguageServerTraceResolver.ts
deleted file mode 100644
index b8cd340ce..000000000
--- a/src/razor/src/razorLanguageServerTraceResolver.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-
-import { LogLevel } from './logLevel';
-import * as vscodeAdapter from './vscodeAdapter';
-import * as vscode from 'vscode';
-
-export function resolveRazorLanguageServerLogLevel(vscodeApi: vscodeAdapter.api) {
- const languageConfig = vscodeApi.workspace.getConfiguration('razor.server');
- const traceString = languageConfig.get('trace');
- const logLevel = parseTraceString(traceString);
-
- return logLevel;
-}
-
-function parseTraceString(traceString: string | undefined) {
- switch (traceString) {
- case 'Trace':
- return LogLevel.Trace;
- case 'Verbose': // For importing old config values
- case 'Debug':
- return LogLevel.Debug;
- case 'Messages': // For importing old config values
- case 'Information':
- return LogLevel.Information;
- case 'Warning':
- return LogLevel.Warning;
- case 'Error':
- return LogLevel.Error;
- case 'Critical':
- return LogLevel.Critical;
- case 'Off': // For importing old config values
- case 'None':
- return LogLevel.None;
-
- default:
- console.log(vscode.l10n.t("Invalid razor.server.trace setting. Defaulting to '{0}'", 'Information'));
- return LogLevel.Information;
- }
-}
diff --git a/src/razor/src/razorLogger.ts b/src/razor/src/razorLogger.ts
index 7d685834b..985f5af3d 100644
--- a/src/razor/src/razorLogger.ts
+++ b/src/razor/src/razorLogger.ts
@@ -8,52 +8,69 @@ import * as path from 'path';
import * as vscodeAdapter from './vscodeAdapter';
import * as vscode from 'vscode';
import { IEventEmitterFactory } from './IEventEmitterFactory';
-import { LogLevel } from './logLevel';
+import { RazorLanguageServerClient } from './razorLanguageServerClient';
export class RazorLogger implements vscodeAdapter.Disposable {
public static readonly logName = 'Razor Log';
- public static readonly verbositySetting = 'razor.server.trace';
public verboseEnabled!: boolean;
public messageEnabled!: boolean;
- public readonly outputChannel: vscode.OutputChannel;
+ public readonly outputChannel: vscode.LogOutputChannel;
+ public languageServerClient: RazorLanguageServerClient | undefined;
private readonly onLogEmitter: vscodeAdapter.EventEmitter;
- private readonly onTraceLevelChangeEmitter: vscodeAdapter.EventEmitter;
- constructor(eventEmitterFactory: IEventEmitterFactory, public logLevel: LogLevel) {
- this.processTraceLevel();
+ constructor(eventEmitterFactory: IEventEmitterFactory) {
+ this.outputChannel = vscode.window.createOutputChannel(vscode.l10n.t('Razor Log'), { log: true });
this.onLogEmitter = eventEmitterFactory.create();
- this.onTraceLevelChangeEmitter = eventEmitterFactory.create();
+ this.processTraceLevel();
- this.outputChannel = vscode.window.createOutputChannel(vscode.l10n.t('Razor Log'));
+ this.outputChannel.onDidChangeLogLevel(async () => {
+ await this.updateLogLevelAsync();
+ });
this.logRazorInformation();
this.setupToStringOverrides();
}
- public setTraceLevel(trace: LogLevel) {
- this.logLevel = trace;
- this.processTraceLevel();
- this.logMessage(`Updated log level to: ${LogLevel[this.logLevel]}`);
- this.onTraceLevelChangeEmitter.fire(this.logLevel);
+ public get logLevel(): vscode.LogLevel {
+ return this.outputChannel.logLevel;
+ }
+
+ /**
+ * Gets the log level in numeric form that matches what is expected in rzls.
+ * Matches https://github.com/dotnet/razor/blob/7390745dcd9c8831d4459437ed2e9e94125f3dd3/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Logging/LogLevel.cs#L6
+ */
+ public get logLevelForRZLS(): number {
+ switch (this.logLevel) {
+ case vscode.LogLevel.Off:
+ return 0;
+ case vscode.LogLevel.Trace:
+ return 1;
+ case vscode.LogLevel.Debug:
+ return 2;
+ case vscode.LogLevel.Info:
+ return 3;
+ case vscode.LogLevel.Warning:
+ return 4;
+ case vscode.LogLevel.Error:
+ return 5;
+ default:
+ throw new Error('Unexpected log level value. Do not know how to convert');
+ }
}
public get onLog() {
return this.onLogEmitter.event;
}
- public get onTraceLevelChange() {
- return this.onTraceLevelChangeEmitter.event;
- }
-
public logAlways(message: string) {
- this.logWithMarker(message);
+ this.outputChannel.info(message);
+ this.onLogEmitter.fire(message);
}
public logWarning(message: string) {
- // Always log warnings
- const warningPrefixedMessage = `(Warning) ${message}`;
- this.logAlways(warningPrefixedMessage);
+ this.outputChannel.warn(message);
+ this.onLogEmitter.fire(message);
}
public logError(message: string, error: unknown) {
@@ -67,13 +84,15 @@ export class RazorLogger implements vscodeAdapter.Disposable {
public logMessage(message: string) {
if (this.messageEnabled) {
- this.logWithMarker(message);
+ this.outputChannel.info(message);
+ this.onLogEmitter.fire(message);
}
}
public logVerbose(message: string) {
if (this.verboseEnabled) {
- this.logWithMarker(message);
+ this.outputChannel.trace(message);
+ this.onLogEmitter.fire(message);
}
}
@@ -81,42 +100,40 @@ export class RazorLogger implements vscodeAdapter.Disposable {
this.outputChannel.dispose();
}
+ private async updateLogLevelAsync() {
+ this.processTraceLevel();
+
+ if (this.languageServerClient) {
+ await this.languageServerClient.sendNotification('razor/updateLogLevel', {
+ logLevel: this.logLevelForRZLS,
+ });
+ }
+ }
+
private logErrorInternal(message: string, error: Error) {
// Always log errors
- const errorPrefixedMessage = `(Error) ${message}
+ const errorPrefixedMessage = `${message}
${error.message}
Stack Trace:
${error.stack}`;
- this.logAlways(errorPrefixedMessage);
- }
-
- private logWithMarker(message: string) {
- const timeString = new Date().toLocaleTimeString();
- const markedMessage = `[Client - ${timeString}] ${message}`;
-
- this.log(markedMessage);
- }
-
- private log(message: string) {
- this.outputChannel.appendLine(message);
-
+ this.outputChannel.error(errorPrefixedMessage);
this.onLogEmitter.fire(message);
}
private logRazorInformation() {
const packageJsonContents = readOwnPackageJson();
- this.log('--------------------------------------------------------------------------------');
- this.log(`Razor.VSCode version ${packageJsonContents.defaults.razor}`);
- this.log('--------------------------------------------------------------------------------');
- this.log(`Razor's log level is currently set to '${LogLevel[this.logLevel]}'`);
- this.log(" - To change Razor's log level set 'razor.server.trace' and then restart VSCode.");
- this.log(" - To report issues invoke the 'Report a Razor issue' command via the command palette.");
- this.log(
+ this.logAlways('--------------------------------------------------------------------------------');
+ this.logAlways(`Razor.VSCode version ${packageJsonContents.defaults.razor}`);
+ this.logAlways('--------------------------------------------------------------------------------');
+ this.logAlways(`Razor's log level is currently set to '${vscode.LogLevel[this.logLevel]}'`);
+ this.logAlways(" - To change Razor's log level use the gear icon on the output window");
+ this.logAlways(" - To report issues invoke the 'Report a Razor issue' command via the command palette.");
+ this.logAlways(
'-----------------------------------------------------------------------' +
'------------------------------------------------------'
);
- this.log('');
+ this.logAlways('');
}
private setupToStringOverrides() {
@@ -130,8 +147,8 @@ ${error.stack}`;
}
private processTraceLevel() {
- this.verboseEnabled = this.logLevel <= LogLevel.Debug;
- this.messageEnabled = this.logLevel <= LogLevel.Information;
+ this.verboseEnabled = this.outputChannel.logLevel >= vscode.LogLevel.Trace;
+ this.messageEnabled = this.outputChannel.logLevel >= vscode.LogLevel.Info;
}
}
diff --git a/src/razor/src/telemetryReporter.ts b/src/razor/src/telemetryReporter.ts
index 8f7e164ab..58bb8cd79 100644
--- a/src/razor/src/telemetryReporter.ts
+++ b/src/razor/src/telemetryReporter.ts
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { createTelemetryErrorEvent, createTelemetryEvent, HostEventStream } from './hostEventStream';
-import { LogLevel } from './logLevel';
+import * as vscode from 'vscode';
export class TelemetryReporter {
private readonly razorExtensionActivated = createTelemetryEvent('VSCode.Razor.RazorExtensionActivated');
@@ -18,9 +18,9 @@ export class TelemetryReporter {
this.eventStream.post(this.razorExtensionActivated);
}
- public reportTraceLevel(trace: LogLevel) {
+ public reportTraceLevel(trace: vscode.LogLevel) {
const traceLevelEvent = createTelemetryEvent('VSCode.Razor.TraceLevel', {
- trace: LogLevel[trace],
+ trace: vscode.LogLevel[trace],
});
this.eventStream.post(traceLevelEvent);
}