前端日志组件,可用于记录用户行为 js-log
- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: http://cardone.top/
- 软件文档: http://wiki.cardone.top/
软件介绍
前端日志组件,可用于记录用户
日志信息发送到日志服务接口
可配置日志服务接口地址
可配置本地浏览器日志打印等级
可配置发送日志服务接口等级
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引用方式
var jsLog = require('js-log');
jsLog.config({
level: 'debug',
url: '/v1/sysmgr/log/c0002.json'
});
jsLog.debug('test');
if (jsLog.isDebugEnabled()) {
alert('isDebugEnabled === true');
}
普通引用方式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../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>
