您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SimulcastLogger.js 556B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. *
  3. * @constructor
  4. */
  5. function SimulcastLogger(name, lvl) {
  6. this.name = name;
  7. this.lvl = lvl;
  8. }
  9. SimulcastLogger.prototype.log = function (text) {
  10. if (this.lvl) {
  11. console.log(text);
  12. }
  13. };
  14. SimulcastLogger.prototype.info = function (text) {
  15. if (this.lvl > 1) {
  16. console.info(text);
  17. }
  18. };
  19. SimulcastLogger.prototype.fine = function (text) {
  20. if (this.lvl > 2) {
  21. console.log(text);
  22. }
  23. };
  24. SimulcastLogger.prototype.error = function (text) {
  25. console.error(text);
  26. };
  27. module.exports = SimulcastLogger;