diff --git a/dutchies-dcs-scripting-tools/src/logger.ts b/dutchies-dcs-scripting-tools/src/logger.ts new file mode 100644 index 0000000..a80a7d5 --- /dev/null +++ b/dutchies-dcs-scripting-tools/src/logger.ts @@ -0,0 +1,26 @@ +import * as vscode from 'vscode'; + +export class Logger { + + private outputChannel: vscode.OutputChannel; + + constructor(){ + this.outputChannel = vscode.window.createOutputChannel('DCS Scripting Tools'); + } + + log(message: string) { + this.outputChannel.appendLine(message); + } + + info(message: string) { + this.outputChannel.appendLine(`[${new Date().toISOString()}][INFO] ${message}`); + } + + error(message: string) { + this.outputChannel.appendLine(`[${new Date().toISOString()}][ERROR] ${message}`); + } + + dispose() { + this.outputChannel.dispose(); + } +} \ No newline at end of file