SaltyMonkey лет назад: 6
Родитель
Сommit
e9dd88242c
1 измененных файлов с 37 добавлено и 0 удалено
  1. 37 0
      lib/unitLog.js

+ 37 - 0
lib/unitLog.js

@@ -0,0 +1,37 @@
+"use strict";
+
+/*
+* Unit for Fps Manager. Log wrapper
+* Author: SaltyMonkey
+* Contributors: 
+*/
+
+/**
+ * @typedef {import("../fpsManager.js").deps} deps
+*/
+
+class unitLog {
+	/**
+	 *Creates an instance of unitLog.
+	 * @param {deps} deps dependencies
+	 * @memberof unitLog
+	 */
+	constructor(deps) {
+		this.__mod = deps.mod;
+
+		console.log("DEBUG: unitLog -> constructor");
+	}
+
+	/**
+	 * @description writes log line into console/game based on settings
+	 * @param {*} msg message
+	 * @memberof unitLog
+	 */
+	send(...msg) {
+		if(this.__mod.settings.cleanChat) this.__mod.log(...msg);
+		else this.__mod.command.message(...msg);
+	}
+
+}
+
+module.exports = unitLog;