mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add enable logs setting for Flat File Import (#7342)
* Add config for enabling Flat File Import logging * Move logs to default log location for extensions * Add localized strings
This commit is contained in:
@@ -50,6 +50,17 @@
|
|||||||
"group": "import"
|
"group": "import"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"configuration":{
|
||||||
|
"type": "object",
|
||||||
|
"title": "%flatfileimport.configuration.title%",
|
||||||
|
"properties": {
|
||||||
|
"flatFileImport.logDebugInfo": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"description": "%flatfileimport.logDebugInfo%"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
4
extensions/import/package.nls.json
Normal file
4
extensions/import/package.nls.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"flatfileimport.configuration.title": "Flat File Import configuration",
|
||||||
|
"flatfileimport.logDebugInfo": "[Optional] Log debug output to the console (View -> Output) and then select appropriate output channel from the dropdown"
|
||||||
|
}
|
||||||
@@ -44,7 +44,7 @@ export class ServiceClient {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
serverdownloader.getOrDownloadServer().then(e => {
|
serverdownloader.getOrDownloadServer().then(e => {
|
||||||
const installationComplete = Date.now();
|
const installationComplete = Date.now();
|
||||||
let serverOptions = this.generateServerOptions(e);
|
let serverOptions = this.generateServerOptions(e, context);
|
||||||
client = new SqlOpsDataClient(Constants.serviceName, serverOptions, clientOptions);
|
client = new SqlOpsDataClient(Constants.serviceName, serverOptions, clientOptions);
|
||||||
const processStart = Date.now();
|
const processStart = Date.now();
|
||||||
client.onReady().then(() => {
|
client.onReady().then(() => {
|
||||||
@@ -90,10 +90,10 @@ export class ServiceClient {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private generateServerOptions(executablePath: string): ServerOptions {
|
private generateServerOptions(executablePath: string, context: vscode.ExtensionContext): ServerOptions {
|
||||||
let launchArgs = [];
|
let launchArgs = [];
|
||||||
launchArgs.push('--log-dir');
|
launchArgs.push('--log-dir');
|
||||||
let logFileLocation = path.join(serviceUtils.getDefaultLogLocation(), 'flatfileimport');
|
let logFileLocation = context.logPath;
|
||||||
launchArgs.push(logFileLocation);
|
launchArgs.push(logFileLocation);
|
||||||
let config = vscode.workspace.getConfiguration(Constants.extensionConfigSectionName);
|
let config = vscode.workspace.getConfiguration(Constants.extensionConfigSectionName);
|
||||||
if (config) {
|
if (config) {
|
||||||
|
|||||||
@@ -18,10 +18,6 @@ export function getAppDataPath(): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDefaultLogLocation(): string {
|
|
||||||
return path.join(getAppDataPath(), 'azuredatastudio');
|
|
||||||
}
|
|
||||||
|
|
||||||
export function ensure(target: object, key: string): any {
|
export function ensure(target: object, key: string): any {
|
||||||
if (target[key] === void 0) {
|
if (target[key] === void 0) {
|
||||||
target[key] = {} as any;
|
target[key] = {} as any;
|
||||||
|
|||||||
Reference in New Issue
Block a user