Change:
Testing open the settings and change the setting open the git output view. Nothing has changed there, no message that the log level has change, not any debug messages the setting is only the initial level. It would be nice if a setting change also change the actual log level . Alternative describe in the settings description that the setting is only represents the initial log level, and that a reload is necessary. (I'd rather prefer the first approach as we want settings to be 'live')

Discussion:
return; } <del> this.outputChannelLogger.setLogLevel(choice.logLevel); </del> <ins> this.outputChannelLogger.currentLogLevel = choice.logLevel; </ins> } @command('git.refresh', { repository: true })

private _onDidChangeLogLevel = new EventEmitter<LogLevel>(); readonly onDidChangeLogLevel: Event<LogLevel> = this._onDidChangeLogLevel.event; <del> private _currentLogLevel: LogLevel; </del> <ins> private _currentLogLevel!: LogLevel; </ins> get currentLogLevel(): LogLevel { return this._currentLogLevel; } <ins> set currentLogLevel(value: LogLevel) { if (this._currentLogLevel === value) { return; } this._currentLogLevel = value; this._onDidChangeLogLevel.fire(value); this.log(localize('gitLogLevel', "Log level: {0}", LogLevel[value])); } </ins> <del> private _defaultLogLevel: LogLevel; </del> <ins> private _defaultLogLevel!: LogLevel; </ins> get defaultLogLevel(): LogLevel { return this._defaultLogLevel; }

commands.registerCommand('git.showOutput', () => this.showOutputChannel()); this._disposables.push(this._outputChannel); <del> // Initialize log level </del> <ins> this._disposables.push(workspace.onDidChangeConfiguration(e => { if (e.affectsConfiguration('git.logLevel')) { this.onLogLevelChange(); } })); this.onLogLevelChange(); } private onLogLevelChange(): void { </ins> const config = workspace.getConfiguration('git'); const logLevel: keyof typeof LogLevel = config.get('logLevel', 'Info'); <del> this._currentLogLevel = this._defaultLogLevel = LogLevel[logLevel] ?? LogLevel.Info; this.logInfo(localize('gitLogLevel', "Log level: {0}", LogLevel[this._currentLogLevel])); </del> <ins> this.currentLogLevel = this._defaultLogLevel = LogLevel[logLevel] ?? LogLevel.Info; </ins> } <del> private log(message: string, logLevel: LogLevel): void { if (logLevel < this._currentLogLevel) { </del> <ins> log(message: string, logLevel?: LogLevel): void { if (logLevel && logLevel < this._currentLogLevel) { </ins> return; } <del> this._outputChannel.appendLine(`[${new Date().toISOString()}] [${LogLevel[logLevel].toLowerCase()}] ${message}`); </del> <ins> this._outputChannel.appendLine(`[${new Date().toISOString()}]${logLevel ? ` [${LogLevel[logLevel].toLowerCase()}]` : ''} ${message}`); </ins> } logCritical(message: string): void {

this.log(message, LogLevel.Warning); } <del> logGitCommand(command: string): void { this._outputChannel.appendLine(`[${new Date().toISOString()}] ${command}`); } setLogLevel(logLevel: LogLevel): void { if (this._currentLogLevel === logLevel) { return; } this._currentLogLevel = logLevel; this._onDidChangeLogLevel.fire(logLevel); this.logInfo(localize('changed', "Log level changed to: {0}", LogLevel[logLevel])); } </del> showOutputChannel(): void { this._outputChannel.show(); }

lines.pop(); } <del> outputChannelLogger.logGitCommand(lines.join('n')); </del> <ins> outputChannelLogger.log(lines.join('n')); </ins> }; git.onOutput.addListener('log', onOutput); disposables.push(toDisposable(() => git.onOutput.removeListener('log', onOutput)));