diff --git a/.vscode/launch.json b/.vscode/launch.json index 96229ff..46eb935 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,20 +10,14 @@ "args": [ "--extensionDevelopmentPath=${workspaceRoot}" ], - "stopOnEntry": false, "sourceMaps": true, "outFiles": [ - "${workspaceRoot}/out/src/**/*.js" + "${workspaceRoot}/dist/**/*.js", + "${workspaceRoot}/common/out/**/*.js" ], "env": { "VSCODE_SSHFS_DEBUG": "TRUE" }, - "windows": { - "env": { - "VSCODE_SSHFS_DEBUG": "TRUE" - } - } - // "preLaunchTask": "npm:watch" } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 267b43e..8e563dd 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,7 +5,10 @@ "tasks": [ { "label": "Extension - Watch all", - "group": "build", + "group": { + "kind": "build", + "isDefault": true + }, "dependsOrder": "sequence", "dependsOn": [ "Extension Common - Watch", @@ -26,7 +29,7 @@ "Extension WebView - Watch" ], "problemMatcher": [], - "isBackground": true, + "isBackground": true }, { "type": "shell", diff --git a/src/logging.ts b/src/logging.ts index b219c0e..a36ddce 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -107,6 +107,8 @@ class Logger { const space = ' '.repeat(Math.max(0, 8 - type.length)); const msg = `[${type}]${space}${prefix}${message}${suffix}` outputChannel.appendLine(msg); + // VS Code issue where console.debug logs twice in the Debug Console + if (type.toLowerCase() === 'debug') type = 'log'; if (DEBUG) (console[type.toLowerCase()] || console.log).call(console, msg); } protected formatValue(value: any, options: LoggingOptions): string { @@ -166,7 +168,7 @@ class Logger { protected printTemplate(type: string, template: TemplateStringsArray, args: any[], partialOptions?: Partial) { const options: LoggingOptions = { ...this.defaultLoggingOptions, ...partialOptions }; options.callStacktraceOffset = (options.callStacktraceOffset || 0) + 1; - this.print(type, template.reduce((acc, part, i) => acc + part + this.formatValue(args[i] || '', options), ''), partialOptions); + this.print(type, template.reduce((acc, part, i) => acc + part + (i < args.length ? this.formatValue(args[i], options) : ''), ''), partialOptions); } public scope(name?: string, generateStack: number | boolean = false) { const logger = new Logger(name, generateStack);