UNPKG

amos-tool

Version:

amos ui tool

38 lines (37 loc) 975 B
var Logger = function() { function o(o, n) { var t = []; t.push(o); for (var s in n) t.push(n[s]); i.log.apply(i, t) } var i = this, n = { TRACE: 0, DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4, FATAL: 5 }, t = ["TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"]; this.log = function() { var o = arguments[0]; o = arguments[0] = "[" + t[o] + "] "; arguments[1]; window.LogConfig && window.LogConfig.isDebug && console.log.apply(console, arguments) }, this.trace = function() { this.log && o(n.TRACE, arguments) }, this.debug = function() { this.log && o(n.DEBUG, arguments) }, this.info = function() { this.log && o(n.INFO, arguments) }, this.warn = function() { this.log && o(n.WARN, arguments) }, this.error = function() { this.log && o(n.ERROR, arguments) }, this.fatal = function() { this.log && o(n.FATAL, arguments) } }; module.exports = new Logger;