vue 日志框架 log4javascript
npm i log4javascriptimport log4javascript from 'log4javascript'Vue.prototype.$log4javascript = log4javascript;var logger = this.$log4javascript.getLogger("main");this.$log4javascript.setEna...
·
npm i log4javascript
import log4javascript from 'log4javascript'
Vue.prototype.$log4javascript = log4javascript;
var logger = this.$log4javascript.getLogger("main");
this.$log4javascript.setEnabled(false);
var appender = new this.$log4javascript.InPageAppender();
appender.layout.pattern='%d{yyyy-MM-dd HH:mm:ss,SSS} [%c] %-5p - %m{1}%n';
appender.visible=false;
logger.addAppender(appender);
logger.debug("This is a debugging message from the log4javascript in-page page");
//
this.$log4javascript.setEnabled(true);
logger.info("显示记录日志.");
appender.show();
appender.visible=true;
在下面自己生成一个控制台。好像挺厉害的样子.
参考资料
更多推荐
已为社区贡献11条内容
所有评论(0)