UNPKG

@aligov/retcodelog

Version:

retcode log上报npm包,适用于 browser|nodejs|weex|E应用

26 lines (24 loc) 684 B
/** * retcode/log * * @Author xianqian.rxq@alibaba-inc.com * @Date 2016-10-09 * @copyright(c) Alibaba Group Holding Limited. */ var isBrowser = typeof window === 'object' && !!window.navigator; var isNodejs = typeof process === 'object' && (process + '' === '[object process]'); // 2018-03-05 yufeng.wjj // weex sandbox不再支持callNative,使用nativeLog判断 var isWeex = typeof callNative === 'function' || typeof nativeLog === 'function'; // weex if (isWeex) { module.exports = require('./log-weex') } // nodejs环境 else if (isNodejs) { module.exports = require('./log-node'); } // 默认browser端 else { module.exports = require('./log-browser'); }