unitLog.js 689 B

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. /*
  3. * Unit for Fps Manager. Log wrapper
  4. * Author: SaltyMonkey
  5. * Contributors:
  6. */
  7. /**
  8. * @typedef {import("../fpsManager.js").deps} deps
  9. */
  10. class unitLog {
  11. /**
  12. *Creates an instance of unitLog.
  13. * @param {deps} deps dependencies
  14. * @memberof unitLog
  15. */
  16. constructor(deps) {
  17. this.__mod = deps.mod;
  18. console.log("DEBUG: unitLog -> constructor");
  19. }
  20. /**
  21. * @description writes log line into console/game based on settings
  22. * @param {*} msg message
  23. * @memberof unitLog
  24. */
  25. send(...msg) {
  26. if(this.__mod.settings.cleanChat) this.__mod.log(...msg);
  27. else this.__mod.command.message(...msg);
  28. }
  29. }
  30. module.exports = unitLog;