javascript - flv.js 实时监控输出日志是如何实现的
问题描述
看了flv.js 未压缩的版本,找不到调用Log的地方,是如何实现实时监控并输出日志的呢?

var Log = function () { function Log() {_classCallCheck(this, Log); } _createClass(Log, null, [{key: ’e’,value: function e(tag, msg) { if (!Log.ENABLE_ERROR) {return; } if (!tag || Log.FORCE_GLOBAL_TAG) tag = Log.GLOBAL_TAG; var str = ’[’ + tag + ’] > ’ + msg; if (console.error) {console.error(str); } else if (console.warn) {console.warn(str); } else {console.log(str); }} }, {key: ’i’,value: function i(tag, msg) { if (!Log.ENABLE_INFO) {return; } if (!tag || Log.FORCE_GLOBAL_TAG) tag = Log.GLOBAL_TAG; var str = ’[’ + tag + ’] > ’ + msg; if (console.info) {console.info(str); } else {console.log(str); }} }, {key: ’w’,value: function w(tag, msg) { if (!Log.ENABLE_WARN) {return; } if (!tag || Log.FORCE_GLOBAL_TAG) tag = Log.GLOBAL_TAG; var str = ’[’ + tag + ’] > ’ + msg; if (console.warn) {console.warn(str); } else {console.log(str); }} }, {key: ’d’,value: function d(tag, msg) { if (!Log.ENABLE_DEBUG) {return; } if (!tag || Log.FORCE_GLOBAL_TAG) tag = Log.GLOBAL_TAG; var str = ’[’ + tag + ’] > ’ + msg; if (console.debug) {console.debug(str); } else {console.log(str); }} }, {key: ’v’,value: function v(tag, msg) { if (!Log.ENABLE_VERBOSE) {return; } if (!tag || Log.FORCE_GLOBAL_TAG) tag = Log.GLOBAL_TAG; console.log(’[’ + tag + ’] > ’ + msg);} }]); return Log;}();Log.GLOBAL_TAG = ’flv.js’;Log.FORCE_GLOBAL_TAG = false;Log.ENABLE_ERROR = true;Log.ENABLE_INFO = true;Log.ENABLE_WARN = true;Log.ENABLE_DEBUG = true;Log.ENABLE_VERBOSE = true;exports.default = Log;
问题解答
回答1:有感叹号, 黄色背景的是 console.warn
console.warn
https://github.com/Bilibili/f...
相关文章:
1. debian - docker依赖的aufs-tools源码哪里可以找到啊?2. dockerfile - 为什么docker容器启动不了?3. angular.js - angular内容过长展开收起效果4. html5 - node静态资源服务器设置了Cache-Control,但浏览器从来不走3045. docker内创建jenkins访问另一个容器下的服务器问题6. 对html实现监测 发现不对7. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?8. 为什么我ping不通我的docker容器呢???9. 如何下载网站里面的图片?10. android - Apk 中找不到r类文件

网公网安备