1.0.3 • Published 2 years ago
cyanery-error-monitor v1.0.3
一、快速开始
1、npm安装
npm i cyanery-error-monitor --save
or
yarn add cyanery-error-monitor
2、使用
import CSI from 'cyanery-error-monitor';
// 示例:自定义上报
const csi = new CSI({
feID: '', // 项目id,日志区分项目使用
key: 6, // 日志查看快捷键
showClear: true, // 展示清空数据按钮(true/false)
report: (lines) => {
// todo 自定义你的上报逻辑
console.log('error lins', lines);
},
onUpdate: (line, lines) => {
// 新增错误信息时的回调函数
// line(当前新增的错误信息)
// lines(当前所有错误列表)
},
});
// 如果你想主动上报
csi.report();