Git Product home page Git Product logo

alloylever's Introduction

AlloyLever

1kb(gzip)代码搞定开发调试发布,错误监控上报,用户问题定位。

  • 支持错误监控和上报
  • 支持 vConsole错误展示
  • 支持开发阶段使用 vConsole
  • 支持生产环境机关拉取 vConsole
  • 支持预埋机关唤起
  • 支持url带参数唤起

url带参数唤起有两个目的,第一是方便网站开发过程中显示vConsole面板,第二是发给投诉反馈网站错误的用户显示vConsole面板用于定位错误。

安装

npm install alloylever

CDN地址下载下来使用:

https://unpkg.com/[email protected]/alloy-lever.js

使用指南

AlloyLever.config({
    cdn:'//s.url.cn/qqun/qun/qqweb/m/qun/confession/js/vconsole.min.js',  //vconsole的CDN地址
    reportUrl: "//a.qq.com",  //错误上报地址
    reportPrefix: 'qun',    //错误上报msg前缀,一般用于标识业务类型
    reportKey: 'msg',        //错误上报msg前缀的key,用户上报系统接收存储msg
    otherReport: {              //需要上报的其他信息
        uin: 491862102
    },
    entry:"#entry"          //请点击这个DOM元素6次召唤vConsole。//你可以通过AlloyLever.entry('#entry2')设置多个机关入口召唤神龙
})

AlloyLever会监听window.onerror并把错误信息保存下来,并且上报到reportUrl,你也可以召唤到vConsole并显示出来错误和相关日志。

url唤起vConsole

只要你的页面引用了AlloyLever,你只需要在你的url里带上 vconsole=show 就能显示vConsole面板。如:

//加载并显示log面板
http://localhost:63342/AlloyLever/index.html?vconsole=show
//加载但不显示log面板
http://localhost:63342/AlloyLever/index.html?vconsole=hide
//不加载vConsole脚本
http://localhost:63342/AlloyLever/index.html

这些url的作用很好理解:

  • 开发阶段用于调试
  • 发给投诉的用户打开带有vconsole=show的url

在线演示

QQ交流群491862102

License

This content is released under the MIT License.

alloylever's People

Contributors

bryant1410 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.