日志信息发送到日志服务接口
可配置日志服务接口地址
可配置本地浏览器日志打印等级
可配置发送日志服务接口等级
AMD引用方式require(['js-log'],function(jsLog){jsLog.config({level:'debug',url:'/v1/sysmgr/log/c0002.json'});jsLog.debug('test');if(jsLog.isDebugEnabled()){alert('isDebugEnabled===true');}});CMD引用方式varjsLog=require('js-log');jsLog.config({level:'debug',url:'/v1/sysmgr/log/c0002.json'});jsLog.debug('test');if(jsLog.isDebugEnabled()){alert('isDebugEnabled===true');}普通引用方式<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>test</title></head><body><scriptsrc="../bower_components/jquery/dist/jquery.min.js"></script><scriptsrc="../dist/js/js-log.min.js"></script><script>jsLog.config({level:'debug',url:'/v1/sysmgr/log/c0002.json'});jsLog.debug('test');if(jsLog.isDebugEnabled()){alert('isDebugEnabled===true');}</script></body></html>
评论