unitLog.js 638 B

1234567891011121314151617181920212223242526272829303132333435
  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. }
  19. /**
  20. * @description writes log line into console/game based on settings
  21. * @param {*} msg message
  22. * @memberof unitLog
  23. */
  24. send(...msg) {
  25. if(this.__mod.settings.cleanChat) this.__mod.log(...msg);
  26. else this.__mod.command.message(...msg);
  27. }
  28. }
  29. module.exports = unitLog;