Skip to content

library for error monitoring and reporting, user problem localization features

License

Notifications You must be signed in to change notification settings

EvanLiu2968/web-sophon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-sophon

Sophon comes from The Trisolaris of Centaurus.

  • error monitoring and remote reporting, it can be configured free.
  • support for vConsole error display.

Install

npm install web-sophon

download the git repository, or use the online https://evanliu2968.github.io/web-sophon/lib/sophon.min.js

Usage

const Sophon = require('web-sophon')
Sophon.config({
  vconsole:'https://s.url.cn/qqun/qun/qqweb/m/qun/confession/js/vconsole.min.js',
  onError: function(errorInfo){
    // you can report it to remote server, follow as demo
    console.log(errorInfo)
    // report test
    var src = "http://www.baidu.com?error=" + errorInfo.msg
    var otherReport = {
      pixel: window.devicePixelRatio,
      platform: window.navigator.platform,
      userAgent: window.navigator.userAgent,
      t: errorInfo.time
    };
    for (var i in otherReport) {
      if (otherReport.hasOwnProperty(i)) {
        src += '&' + i + '=' + otherReport[i]
      }
    }
    new Image().src = src
  }
})

the library will listen to window.onerror and save the error information, and report to reportUrl, you can also call vConsole and display errors and related logs.

DEMO

https://EvanLiu2968.github.io/web-sophon/

资料参考

License

MIT

About

library for error monitoring and reporting, user problem localization features

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published