|
|
@ -6,6 +6,8 @@ import { ExtensionOutputChannelName } from './constants'; |
|
|
|
|
|
|
|
const ConsolePrefix = `[${ExtensionOutputChannelName}]`; |
|
|
|
|
|
|
|
const isDebuggingRegex = /^--inspect(-brk)?=?/; |
|
|
|
|
|
|
|
export class Logger { |
|
|
|
|
|
|
|
static debug = false; |
|
|
@ -88,4 +90,17 @@ export class Logger { |
|
|
|
} |
|
|
|
this.gitOutput.appendLine(`${this.timestamp} ${command} (${cwd})${ex === undefined ? '' : `\n\n${ex.toString()}`}`); |
|
|
|
} |
|
|
|
|
|
|
|
private static _isDebugging: boolean | undefined; |
|
|
|
static get isDebugging() { |
|
|
|
if (this._isDebugging === undefined) { |
|
|
|
const args = process.execArgv; |
|
|
|
|
|
|
|
this._isDebugging = args |
|
|
|
? args.some(arg => isDebuggingRegex.test(arg)) |
|
|
|
: false; |
|
|
|
} |
|
|
|
|
|
|
|
return this._isDebugging; |
|
|
|
} |
|
|
|
} |