export default function logger() {
var logger = function logger(){
};
logger.LEVEL = {
RUN : 0,
ERROR : 1,
WARN : 2,
LOG : 3,
INFO : 4,
DEBUG : 5,
FULL : 5,
};
logger.level = logger.LEVEL.FULL;
logger.debug = function(msg){ (this.level >= this.LEVEL.DEBUG) && console.debug(msg); };
logger.info = function(msg){ (this.level >= this.LEVEL.INFO) && console.info("%c "+ msg, "color: green"); };
logger.log = function(msg){ (this.level >= this.LEVEL.LOG) && console.log(msg); };
logger.warn = function(msg){ (this.level >= this.LEVEL.WARN) && console.warn(msg); };
logger.error = function(msg){ (this.level >= this.LEVEL.ERROR) && console.error(msg); };
return logger;
}
Last active
August 14, 2020 17:03
-
-
Save Phalacrocorax/f41f98432ad02a22e337cfdeeab768b5 to your computer and use it in GitHub Desktop.
[snippets] javascripts/js
Fashion frontend uh-huh
从gulp, sass, webpack, AMD, CommonJS, vuejs, vuex, es2015, babel, transpile 层出不穷。 本来npm这些nodejs之流就苦手 但是12条专业的JavaScript规则 | kancloud中有提到JS应该自动构建,实际使用中也确实的体会到了方便之处, 比如用了sass之后,再去改css简直就是折磨。
JavaScript Transpilers: What They Are & Why We Need Them
Uncaught TypeError / Uncaught RangeError / Uncaught URIError / InvalidStateError
有个一个自己常见的error: uncaught(in promise) message(The message port closed before a response was received)
目前只找到一篇讲promise的文章: You're Missing the Point of Promises
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Grab Data | js
755 daily latest posting time analysis
Get tweets with replies