mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add debug config option to azdata extension (#11999)
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -19,6 +19,19 @@
|
|||||||
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||||
},
|
},
|
||||||
"main": "./out/extension",
|
"main": "./out/extension",
|
||||||
|
"contributes": {
|
||||||
|
"configuration": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "%azdata.config.title%",
|
||||||
|
"properties": {
|
||||||
|
"azdata.logDebugInfo": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"description": "%azdata.config.debug%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"semver": "^7.3.2",
|
"semver": "^7.3.2",
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
"azdata.displayName": "azdata",
|
"azdata.displayName": "azdata",
|
||||||
"azdata.description": "Support for Azure Data CLI. See https://docs.microsoft.com/cli/azure/?view=azure-cli-latest for more information."
|
"azdata.description": "Support for Azure Data CLI. See https://docs.microsoft.com/cli/azure/?view=azure-cli-latest for more information.",
|
||||||
|
"azdata.config.title": "azdata Configuration",
|
||||||
|
"azdata.config.debug": "Log debug info to the output channel for all executed azdata commands"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { HttpClient } from './common/httpClient';
|
|||||||
import Logger from './common/logger';
|
import Logger from './common/logger';
|
||||||
import { getErrorMessage, searchForCmd } from './common/utils';
|
import { getErrorMessage, searchForCmd } from './common/utils';
|
||||||
import * as loc from './localizedConstants';
|
import * as loc from './localizedConstants';
|
||||||
|
import { azdataConfigSection, debugConfigKey } from './constants';
|
||||||
|
|
||||||
export const azdataHostname = 'https://aka.ms';
|
export const azdataHostname = 'https://aka.ms';
|
||||||
export const azdataUri = 'azdata-msi';
|
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>> {
|
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 {
|
try {
|
||||||
const output = JSON.parse((await executeCommand(`"${this.path}"`, args.concat(['--output', 'json']), additionalEnvVars)).stdout);
|
const output = JSON.parse((await executeCommand(`"${this.path}"`, args.concat(['--output', 'json']), additionalEnvVars)).stdout);
|
||||||
return {
|
return {
|
||||||
|
|||||||
8
extensions/azdata/src/constants.ts
Normal file
8
extensions/azdata/src/constants.ts
Normal 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';
|
||||||
Reference in New Issue
Block a user