rn-blockmonitor

0.0.44 • Public • Published

rn昆虫上报使用步骤:

1。package.json dependencies配置"rn-blockmonitor": "^0.0.34"

2。项目入口文件index.js导入require('rn-blockmonitor').StartMonitor(config);

require('rn-blockmonitor').StartMonitor({

  /*
    require↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
     */
  /*
    线上-上报数据开关
    true:打开,上线后开启
    false:关闭(default)
     */
  onlineUploadStackSwitchOn: false,
  /*
  上报url
  可自定义
   */
  uploadStackUrl: 'http://...',
  /*
 调用栈上限
 200(default)
 可自定义
   */
  recordLength: 200,

  /*
    线下-上报数据开关
    true:打开
    false:关闭(default)
     */
  offlineUploadStackSwitchOn: false,
  /*
  监控开关
  true:关闭
  false:打开(default)
   */
  stopWatchdog: false,
  /*
   remote debugging模式,配置该字段,控制台会额外打印超过该阀值的调用栈
    */
  showLocalConsoleLogByTimeInterval: 30
});

AppRegistry.registerComponent('Wuba', () => HomeView);

3。配置babel.config.js plugins

module.exports = {
   presets: ['module:metro-react-native-babel-preset'],
   plugins: [
                ['rn-blockmonitor/lib/BMStackRecorder', {
               
                /*
                  require online
                   */
                /*
                 项目源码所在根目录,node_modules平级
                 '/App'(default)
                 不能为空,填写实际目录即可
                  */
                root: '/App',
      
      
                /*
                option debug
                 */
                /*
                打印工程指定文件插桩后代码
                默认空串
                 */
                showLocalTerminalCodeByFileName: '',
                /*
                打印工程所有文件插桩后代码
                默认false
                 */
                showLocalTerminalCodeByAllFile: false
              }
              ]
           ]
 };

Dependents (0)

Package Sidebar

Install

npm i rn-blockmonitor

Weekly Downloads

1

Version

0.0.44

License

ISC

Unpacked Size

43 kB

Total Files

16

Last publish

Collaborators

  • dugz
  • shipengcheng