Description
A SDK for wx miniprogramme error and performance monitor, using event subscription.
Feature
Install
NPM
npm i femonitor-wx -S
Directly download
Click here to dowload femonitor-wx sdk
Usage
const { Monitor } = require("./lib/femonitor-wx/index.umd");
const monitor = Monitor.init(options);
monitor.on("event", (eventName, emitData) => {
console.log(eventName, emitData);
});
DefaultOptions
Options param will be deepmerge into defaultOptions
export const defaultOptions = {
env: Env.Dev,
isSystemInfo: true,
isNetwork: true,
httpTimeout: 0,
error: {
filters: [],
random: 1
},
behavior: {
isFilterConsole: false,
queueLimit: 20,
methodWhiteList: [],
methodBlackList: []
},
performance: {
watch: true,
queueLimit: 20
}
};
Support events
EventName | Description |
---|
jsError | app.onError |
unhandleRejection | app.onunhandledrejection |
reqError | Network request error |
performanceInfoReady | Page performance data is ready |
slowHttpRequest | Emit when http request cost time larger than timeout httpTimeout |
event | Emit for all events above |
Development
npm run watch
Build
npm run build