{"_id":"chimee-plugin-log","_rev":"1038553","name":"chimee-plugin-log","description":"LogPlugin for chimee","dist-tags":{"latest":"0.0.4"},"maintainers":[{"email":"welefen@gmail.com","name":"welefen"},{"email":"522963130@qq.com","name":"songguangyu"},{"email":"353904974@qq.com","name":"toxicjohann"},{"email":"18636404184@163.com","name":"yandeqiang"},{"email":"huzunjie@pyzy.net","name":"huzunjie"}],"time":{"modified":"2024-09-14T16:58:23.000Z","created":"2017-07-14T10:24:11.491Z","0.0.4":"2017-11-16T13:06:33.759Z","0.0.3":"2017-08-02T08:48:08.985Z","0.0.2":"2017-08-02T06:59:56.346Z","0.0.1":"2017-07-14T10:24:11.491Z"},"users":{},"author":{"name":"huzunjie"},"repository":{"type":"git","url":"git+https://github.com/Chimeejs/chimee-plugin-log.git"},"versions":{"0.0.4":{"name":"chimee-plugin-log","version":"0.0.4","description":"LogPlugin for chimee","main":"lib/index.js","module":"lib/index.mjs","jsnext:main":"lib/index.mjs","browser":"lib/index.browser.js","scripts":{"test":"jest --coverage","start":"jest --coverage --watch","lint":"eslint ./src --fix","precommit":"npm run lint","prepush":"npm run test","build":"npm run b-common && npm run b-es && npm run b-umd && npm run b-min","b-common":"rollup -c build/rollup.config.common.js","b-es":"rollup -c build/rollup.config.es.js","b-umd":"rollup -c build/rollup.config.umd.js","b-min":"rollup -c build/rollup.config.min.js"},"repository":{"type":"git","url":"git+https://github.com/Chimeejs/chimee-plugin-log.git"},"keywords":["plugin","chimee","log","video"],"author":{"name":"huzunjie"},"license":"MIT","bugs":{"url":"https://github.com/Chimeejs/chimee-plugin-log/issues"},"homepage":"https://github.com/Chimeejs/chimee-plugin-log#readme","dependencies":{"babel-runtime":"^6.26.0","chimee-helper":"^0.2.6","chimee-plugin-popup":"0.0.5"},"devDependencies":{"babel-eslint":"^8.0.2","babel-jest":"^21.2.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015-rollup":"^3.0.0","babel-preset-latest":"^6.24.1","chimee":"^0.5.1","chimee-plugin-controlbar":"^0.3.5","cssnano":"^3.10.0","eslint":"^4.3.0","eslint-plugin-jest":"^21.3.2","identity-obj-proxy":"^3.0.0","jest":"^21.2.1","postcss-nested":"^2.1.0","rollup":"^0.51.6","rollup-plugin-babel":"^3.0.2","rollup-plugin-commonjs":"^8.2.6","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-postcss":"^0.5.4","rollup-plugin-uglify":"^2.0.1"},"jest":{"modulePaths":["src"],"moduleFileExtensions":["js"],"moduleDirectories":["node_modules","bower_components"],"moduleNameMapper":{"\\.css$":"identity-obj-proxy"},"transform":{".*":"babel-jest"}},"gitHead":"c042d073618dec43c36e5186477ff191d8c4e5c7","_id":"chimee-plugin-log@0.0.4","_npmVersion":"5.3.0","_nodeVersion":"8.0.0","_npmUser":{"name":"huzunjie","email":"huzunjie@pyzy.net"},"dist":{"integrity":"sha512-GJnj21nSBixBhyYfpqTIqWJRGcmRmHpeHvHIVWJLlKnld7JOU3yE4HX1S5y1A0tW20gy41xS64EnsoDtDROS1A==","shasum":"4d889a017041b30df1700bfa80c6a389d93c2385","tarball":"http://registry-npm.ywwl.com/chimee-plugin-log/download/chimee-plugin-log-0.0.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDg1WHy6TUqHzeqWwz0lrciyWLwAZ3V2YaSS+j8UgjiJAiEA/SEIsQ7Nx0i3CSeXHgG/mr4ViMYIbk4JUf09j+Wm2fc="}],"size":80592,"noattachment":false,"key":"/chimee-plugin-log/-/chimee-plugin-log-0.0.4.tgz"},"maintainers":[{"email":"welefen@gmail.com","name":"welefen"},{"email":"522963130@qq.com","name":"songguangyu"},{"email":"353904974@qq.com","name":"toxicjohann"},{"email":"18636404184@163.com","name":"yandeqiang"},{"email":"huzunjie@pyzy.net","name":"huzunjie"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chimee-plugin-log-0.0.4.tgz_1510837593694_0.2542045779991895"},"directories":{},"publish_time":1510837593759,"_cnpm_publish_time":1510837593759},"0.0.3":{"name":"chimee-plugin-log","version":"0.0.3","description":"LogPlugin for chimee","main":"lib/index.js","module":"lib/index.mjs","jsnext:main":"lib/index.mjs","browser":"lib/index.browser.js","scripts":{"test":"jest --coverage","start":"jest --coverage --watch","lint":"eslint ./src --fix","precommit":"npm run lint","prepush":"npm run test","build":"npm run b-common && npm run b-es && npm run b-umd && npm run b-min","b-common":"rollup -c build/rollup.config.common.js","b-es":"rollup -c build/rollup.config.es.js","b-umd":"rollup -c build/rollup.config.umd.js","b-min":"rollup -c build/rollup.config.min.js"},"repository":{"type":"git","url":"git+https://github.com/Chimeejs/chimee-plugin-log.git"},"keywords":["plugin","chimee","log","video"],"author":{"name":"huzunjie"},"license":"ISC","bugs":{"url":"https://github.com/Chimeejs/chimee-plugin-log/issues"},"homepage":"https://github.com/Chimeejs/chimee-plugin-log#readme","dependencies":{"babel-runtime":"^6.25.0","chimee-helper":"^0.1.15","chimee-plugin-popup":"0.0.3"},"devDependencies":{"babel-eslint":"^7.2.3","babel-jest":"^20.0.3","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015-rollup":"^3.0.0","babel-preset-latest":"^6.24.1","chimee":"^0.2.4","chimee-plugin-controlbar":"^0.1.3","cssnano":"^3.10.0","eslint":"^4.3.0","eslint-plugin-jest":"^20.0.3","identity-obj-proxy":"^3.0.0","jest":"^20.0.4","postcss-nested":"^2.1.0","rollup":"^0.45.1","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-postcss":"^0.5.4","rollup-plugin-uglify":"^2.0.1"},"jest":{"modulePaths":["src"],"moduleFileExtensions":["js"],"moduleDirectories":["node_modules","bower_components"],"moduleNameMapper":{"\\.css$":"identity-obj-proxy"},"transform":{".*":"babel-jest"}},"gitHead":"bf8efa8fb1b8487c5659010fc430ffdfcc9b2114","_id":"chimee-plugin-log@0.0.3","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"huzunjie","email":"huzunjie@pyzy.net"},"dist":{"integrity":"sha512-BmYEFWhA4GYCp75i4tqoR84koy4NUj2Fdk4mELthlbovcQyATjmOvKiddXGru4BVqSCIl7s2PY47SMdeH+HzmA==","shasum":"911a167732ce80cae46a2bc489bf225ccce9c3ea","tarball":"http://registry-npm.ywwl.com/chimee-plugin-log/download/chimee-plugin-log-0.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDC0v+24BnZcy1BPbJBoMsKs5uRrwEnkcDMsOHuUK+pkgIgdC1MlE4x8XlW9Kse0jcIzqhtt3z4r4j85NxZ7p9YLDE="}],"size":61831,"noattachment":false,"key":"/chimee-plugin-log/-/chimee-plugin-log-0.0.3.tgz"},"maintainers":[{"name":"huzunjie","email":"huzunjie@pyzy.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chimee-plugin-log-0.0.3.tgz_1501663688863_0.6415917796548456"},"directories":{},"publish_time":1501663688985,"_cnpm_publish_time":1501663688985},"0.0.2":{"name":"chimee-plugin-log","version":"0.0.2","description":"LogPlugin for chimee","main":"lib/index.js","module":"lib/index.mjs","jsnext:main":"lib/index.mjs","browser":"lib/index.browser.js","scripts":{"test":"jest --coverage","start":"jest --coverage --watch","lint":"eslint ./src --fix","precommit":"npm run lint","prepush":"npm run test","build":"npm run b-common && npm run b-es && npm run b-umd && npm run b-min","b-common":"rollup -c build/rollup.config.common.js","b-es":"rollup -c build/rollup.config.es.js","b-umd":"rollup -c build/rollup.config.umd.js","b-min":"rollup -c build/rollup.config.min.js"},"repository":{"type":"git","url":"git+https://github.com/Chimeejs/chimee-plugin-log.git"},"keywords":["plugin","chimee","log","video"],"author":{"name":"huzunjie"},"license":"ISC","bugs":{"url":"https://github.com/Chimeejs/chimee-plugin-log/issues"},"homepage":"https://github.com/Chimeejs/chimee-plugin-log#readme","dependencies":{"babel-runtime":"^6.23.0","chimee-helper":"^0.1.10","chimee-plugin-popup":"0.0.2"},"devDependencies":{"babel-eslint":"^7.2.3","babel-jest":"^20.0.3","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015-rollup":"^3.0.0","babel-preset-latest":"^6.24.1","chimee":"^0.2.3","chimee-plugin-controlbar":"^0.1.3","cssnano":"^3.10.0","eslint":"^4.2.0","eslint-plugin-jest":"^20.0.3","identity-obj-proxy":"^3.0.0","jest":"^20.0.4","postcss-nested":"^2.0.2","rollup":"^0.45.1","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-postcss":"^0.5.3","rollup-plugin-uglify":"^2.0.1"},"jest":{"modulePaths":["src"],"moduleFileExtensions":["js"],"moduleDirectories":["node_modules","bower_components"],"moduleNameMapper":{"\\.css$":"identity-obj-proxy"},"transform":{".*":"babel-jest"}},"gitHead":"86098b16b881e3fb9968ab3e0c273b26c3701766","_id":"chimee-plugin-log@0.0.2","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"huzunjie","email":"huzunjie@pyzy.net"},"dist":{"integrity":"sha512-D4cTDf5Rtze+pfVaw8vg/JteDimck/BGMN1d2o5CtdcIR6Aa2SkjB1cUUrGGdg91YNf+GIef943B6ldHpXxO/A==","shasum":"b5eafaf8a2d3711a44530293ffdc05034cef9774","tarball":"http://registry-npm.ywwl.com/chimee-plugin-log/download/chimee-plugin-log-0.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMIgrni23weVeV6Lo+68dARvNMLSPUHXdTeHG7g4FebgIgIuWRdWWz4xiLSpmpvOTcD+0f6sLH0Omml4XwWn5saxI="}],"size":69713,"noattachment":false,"key":"/chimee-plugin-log/-/chimee-plugin-log-0.0.2.tgz"},"maintainers":[{"name":"huzunjie","email":"huzunjie@pyzy.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chimee-plugin-log-0.0.2.tgz_1501657196257_0.36886292113922536"},"directories":{},"publish_time":1501657196346,"_cnpm_publish_time":1501657196346},"0.0.1":{"name":"chimee-plugin-log","version":"0.0.1","description":"LogPlugin for chimee","main":"lib/index.js","module":"lib/index.mjs","jsnext:main":"lib/index.mjs","browser":"lib/index.browser.js","scripts":{"test":"jest --coverage","start":"jest --coverage --watch","lint":"eslint ./src --fix","precommit":"npm run lint","prepush":"npm run test","build":"npm run b-common && npm run b-es && npm run b-umd && npm run b-min","b-common":"rollup -c build/rollup.config.common.js","b-es":"rollup -c build/rollup.config.es.js","b-umd":"rollup -c build/rollup.config.umd.js","b-min":"rollup -c build/rollup.config.min.js"},"repository":{"type":"git","url":"git+https://github.com/Chimeejs/chimee-plugin-log.git"},"keywords":["plugin","chimee","log","video"],"author":{"name":"huzunjie"},"license":"ISC","bugs":{"url":"https://github.com/Chimeejs/chimee-plugin-log/issues"},"homepage":"https://github.com/Chimeejs/chimee-plugin-log#readme","dependencies":{"babel-runtime":"^6.23.0","chimee-helper":"^0.1.10","chimee-plugin-popup":"0.0.2"},"devDependencies":{"babel-eslint":"^7.2.3","babel-jest":"^20.0.3","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015-rollup":"^3.0.0","babel-preset-latest":"^6.24.1","cssnano":"^3.10.0","eslint":"^4.2.0","eslint-plugin-jest":"^20.0.3","identity-obj-proxy":"^3.0.0","jest":"^20.0.4","postcss-nested":"^2.0.2","rollup":"^0.45.1","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-postcss":"^0.5.3","rollup-plugin-uglify":"^2.0.1"},"jest":{"modulePaths":["src"],"moduleFileExtensions":["js"],"moduleDirectories":["node_modules","bower_components"],"moduleNameMapper":{"\\.css$":"identity-obj-proxy"},"transform":{".*":"babel-jest"}},"gitHead":"40d103d269919f38721f8cab11f45b4c4cb46a62","_id":"chimee-plugin-log@0.0.1","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"huzunjie","email":"huzunjie@pyzy.net"},"dist":{"integrity":"sha512-3065lEJq13VZ21hSfJD5UxVjkGNmql59PiUxn9kYveJauu4hdgFAYUjMjmo7cMSG9sAQJXhIr78c+0srzw2ADw==","shasum":"5cbc179c01aadab45a124db81391739bc08637e7","tarball":"http://registry-npm.ywwl.com/chimee-plugin-log/download/chimee-plugin-log-0.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAtKMxFYf4HPFNlyP5vSZ9jXSxJk5NtWv5RzZd4s93PsAiB5oDCfPRnyiGCqfbK8Q/LsEwrBC8dnYgrKOQZNQoW5yg=="}],"size":68391,"noattachment":false,"key":"/chimee-plugin-log/-/chimee-plugin-log-0.0.1.tgz"},"maintainers":[{"name":"huzunjie","email":"huzunjie@pyzy.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chimee-plugin-log-0.0.1.tgz_1500027851391_0.4795143778901547"},"directories":{},"publish_time":1500027851491,"_cnpm_publish_time":1500027851491}},"readme":"# LogPlugin of Chimee\n\n实现日志输出及打点上报逻辑，可用于异常跟踪等。\n本插件继承自[popup插件](https://github.com/Chimeejs/chimee-plugin-popup)实现具备相应功能函数。\n\n## 默认菜单基本用法\n\n> 使用默认日志输出，不做定制或修改。\n\n```javascript\nimport myLog from 'chimee-plugin-log';\nChimee.install(myLog);\nconst chimee = new Chimee({\n  wrapper: '#wrapper',\n  plugins: [myLog.name]\n});\n// 打开日志输出\nchimee[myLog.name].open();\n// 关闭日志输出\nchimee[myLog.name].close();\n```\n> 提示：打开后才开始有日志输出到textarea中，所以如果想看完整日志，可以选择“下次自动打开”，然后保证下一次开启页面后能从初始化开始自动输出日志。\n\n效果示例：\n\n![](https://p2.ssl.qhimg.com/dr/600__/t01093aadbd9d752527.png)\n\n## 打点上报\n> 通常我们需要将关键环节的日志信息上传到服务端，以生成观看报表、异常报表等数据分析内容。\n> 你可以参考以下代码配置实现日志上报。\n\n```javascript\nimport myLog from 'chimee-plugin-log';\nChimee.install(myLog);\nconst chimee = new Chimee({\n  wrapper: '#wrapper',\n  plugins: [{\n    name: myLog.name,\n    // 告诉插件你有一个可以接受日志上报的服务端接口\n    logPostUrl: 'https://myDomain.xx/log_push'\n  }]\n});\n```\n这样默认的关键环节将自动上报日志到服务端，除了相应时长数据，包含以下基本数据信息：\n```\nref - location.href\npro - location.protocol\nbox - chimeeConfig.box\ntype - chimeeConfig.type\nsrc - chimeeConfig.src\nuid - 插件内部计算产生\nver - chimee 版本\nevt - 日志名称\n_t - 时间戳\n_r - 随机数\n```\n\n目前系统插件默认会执行打点上报的环节包含：`loadstart` `canplay` `ended` `playing` `pause` `waiting` `timeout` `error` `destroy`。\n其中的超时事件 `timeout` 对应默认等待载入时长 `logPlugin.timeoutDelay`，默认值为30000毫秒。\n\n如果你想增加其他事件环节的打点，可以像下面这样实现：\n```javascript\nimport myLog from 'chimee-plugin-log';\nChimee.install(myLog);\nconst chimee = new Chimee({\n  wrapper: '#wrapper',\n  plugins: [{\n    name: myLog.name,\n    // 告诉插件你有一个可以接受日志上报的服务端接口\n    logPostUrl: 'https://myDomain.xx/log_push',\n    events: {\n      play: () => {\n        this.sendLog('日志名称', { src: this.src, 'myData': '想要上报的数据' });\n      }\n    }\n  }]\n});\n```\n\n如果你需要对输出或上报的打点数据进行加工，可以像下面这样实现：\n```javascript\nimport myLog from 'chimee-plugin-log';\nChimee.install(myLog);\nconst chimee = new Chimee({\n  wrapper: '#wrapper',\n  plugins: [{\n    name: myLog.name,\n    // 告诉插件你有一个可以接受日志上报的服务端接口\n    logPostUrl: 'https://myDomain.xx/log_push',\n    methods: {\n      // 自定义loadstart环节输出日志包含的数据格式\n      write_loadstart_log: (evt, logData) => {\n        return Object.assign(logData, {\n          src: this.src,\n          'myData': '想要输出的数据'\n        });\n      },\n      // 自定义loadstart环节上报日志包含的数据格式\n      send_loadstart_log: (evt, logData) => {\n        return Object.assign(logData, {\n          src: this.src,\n          'myData': '想要上报的数据'\n        });\n      }\n    }\n  }]\n});\n```\n\n希望您用着方便，有相应问题请随时反馈。\n\n","_attachments":{},"homepage":"https://github.com/Chimeejs/chimee-plugin-log#readme","bugs":{"url":"https://github.com/Chimeejs/chimee-plugin-log/issues"},"license":"MIT"}