diff --git a/src/env.ts b/src/env.ts index 3ec293d..a7fed6e 100644 --- a/src/env.ts +++ b/src/env.ts @@ -6,9 +6,9 @@ import path from 'path'; type EditorVersion = '1.0' | '2.0' | 'unknown'; export class Env { - private logger: vscode.OutputChannel; + private logger: vscode.LogOutputChannel; - constructor(logger: vscode.OutputChannel) { + constructor(logger: vscode.LogOutputChannel) { this.logger = logger; } @@ -201,13 +201,13 @@ export class Env { })(), ]); - this.logger.appendLine(`editorUri: ${this.editorUri?.fsPath}`); - this.logger.appendLine(`editorExeUri: ${this.editorExeUri?.fsPath}`); - this.logger.appendLine(`editorVersion: ${this.editorVersion}`); - this.logger.appendLine(`mapUri: ${this.mapUri}`); - this.logger.appendLine(`projectUri: ${this.projectUri}`); - this.logger.appendLine(`scriptUri: ${this.scriptUri?.fsPath}`); - this.logger.appendLine(`y3Uri: ${this.y3Uri?.fsPath}`); + this.logger.info(`editorUri: ${this.editorUri?.fsPath}`); + this.logger.info(`editorExeUri: ${this.editorExeUri?.fsPath}`); + this.logger.info(`editorVersion: ${this.editorVersion}`); + this.logger.info(`mapUri: ${this.mapUri}`); + this.logger.info(`projectUri: ${this.projectUri}`); + this.logger.info(`scriptUri: ${this.scriptUri?.fsPath}`); + this.logger.info(`y3Uri: ${this.y3Uri?.fsPath}`); } public async waitReady() { diff --git a/src/extension.ts b/src/extension.ts index f3238b4..78c9fc1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -6,7 +6,7 @@ import { GameLauncher } from './launchGame'; class Helper { private context: vscode.ExtensionContext; - private logger: vscode.OutputChannel; + private logger: vscode.LogOutputChannel; private env: Env; constructor(context: vscode.ExtensionContext) { @@ -21,7 +21,7 @@ class Helper { vscode.workspace.onDidChangeConfiguration(async (event) => { if (event.affectsConfiguration('Y3-Helper.EditorPath')) { this.env = new Env(this.logger); - this.logger.appendLine('配置已更新,已重新加载环境'); + this.logger.info('配置已更新,已重新加载环境'); } }); } @@ -49,7 +49,7 @@ class Helper { recursive: true, useTrash: true, }); - this.logger.appendLine(`已将原有的 ${y3Uri.fsPath} 目录移至回收站`); + this.logger.info(`已将原有的 ${y3Uri.fsPath} 目录移至回收站`); } catch (error) { vscode.window.showErrorMessage(`${y3Uri.fsPath} 已被占用,请手动删除它!`); return;