Add debug config option to azdata extension (#11999)

This commit is contained in:
Charles Gagnon
2020-08-28 07:04:47 -07:00
committed by GitHub
parent e9c5a6dfbd
commit 4789f2165b
5 changed files with 29 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ import { HttpClient } from './common/httpClient';
import Logger from './common/logger';
import { getErrorMessage, searchForCmd } from './common/utils';
import * as loc from './localizedConstants';
import { azdataConfigSection, debugConfigKey } from './constants';
export const azdataHostname = 'https://aka.ms';
export const azdataUri = 'azdata-msi';
@@ -118,6 +119,10 @@ export class AzdataTool implements IAzdataTool {
}
public async executeCommand<R>(args: string[], additionalEnvVars?: { [key: string]: string }): Promise<azdataExt.AzdataOutput<R>> {
const debug = vscode.workspace.getConfiguration(azdataConfigSection).get(debugConfigKey);
if (debug) {
args.push('--debug');
}
try {
const output = JSON.parse((await executeCommand(`"${this.path}"`, args.concat(['--output', 'json']), additionalEnvVars)).stdout);
return {

View File

@@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export const azdataConfigSection = 'azdata';
export const debugConfigKey = 'logDebugInfo';