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:
Charles Gagnon
2019-09-24 18:07:46 -07:00
committed by GitHub
parent 82b19614e1
commit a29ae4d3b9
4 changed files with 18 additions and 7 deletions

View File

@@ -50,6 +50,17 @@
"group": "import"
}
]
},
"configuration":{
"type": "object",
"title": "%flatfileimport.configuration.title%",
"properties": {
"flatFileImport.logDebugInfo": {
"type": "boolean",
"default": false,
"description": "%flatfileimport.logDebugInfo%"
}
}
}
},
"dependencies": {

View 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"
}

View File

@@ -44,7 +44,7 @@ export class ServiceClient {
return new Promise((resolve, reject) => {
serverdownloader.getOrDownloadServer().then(e => {
const installationComplete = Date.now();
let serverOptions = this.generateServerOptions(e);
let serverOptions = this.generateServerOptions(e, context);
client = new SqlOpsDataClient(Constants.serviceName, serverOptions, clientOptions);
const processStart = Date.now();
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 = [];
launchArgs.push('--log-dir');
let logFileLocation = path.join(serviceUtils.getDefaultLogLocation(), 'flatfileimport');
let logFileLocation = context.logPath;
launchArgs.push(logFileLocation);
let config = vscode.workspace.getConfiguration(Constants.extensionConfigSectionName);
if (config) {

View File

@@ -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 {
if (target[key] === void 0) {
target[key] = {} as any;