Reenable logging for SQL Tools Service (#1089)

This commit is contained in:
Matt Irvine
2018-04-05 16:04:18 -07:00
committed by GitHub
parent a6ba44e435
commit d97d2e5c91
2 changed files with 10 additions and 1 deletions

View File

@@ -9,3 +9,5 @@ export const providerId = 'MSSQL';
export const serviceCrashMessage = 'SQL Tools Service component exited unexpectedly. Please restart SQL Operations Studio.';
export const serviceCrashButton = 'View Known Issues';
export const serviceCrashLink = 'https://github.com/Microsoft/vscode-mssql/wiki/SqlToolsService-Known-Issues';
export const configLogDebugInfo = 'logDebugInfo';
export const extensionConfigSectionName = 'mssql';

View File

@@ -47,7 +47,7 @@ export async function activate(context: vscode.ExtensionContext) {
let clientOptions: ClientOptions = {
documentSelector: ['sql'],
synchronize: {
configurationSection: 'mssql'
configurationSection: Constants.extensionConfigSectionName
},
providerId: Constants.providerId,
errorHandler: new LanguageClientErrorHandler(),
@@ -99,6 +99,13 @@ function generateServerOptions(executablePath: string): ServerOptions {
launchArgs.push('--log-dir');
let logFileLocation = path.join(Utils.getDefaultLogLocation(), 'mssql');
launchArgs.push(logFileLocation);
let config = vscode.workspace.getConfiguration(Constants.extensionConfigSectionName);
if (config) {
let logDebugInfo = config[Constants.configLogDebugInfo];
if (logDebugInfo) {
launchArgs.push('--enable-logging');
}
}
return { command: executablePath, args: launchArgs, transport: TransportKind.stdio };
}