提交 ad27f7ca 编写于 作者: fxy060608's avatar fxy060608

no message

上级 71847843
......@@ -3,17 +3,24 @@ function typof (v) {
return s.substring(8, s.length - 1)
}
function isDebugMode () {
function isDebugMode () {
/* eslint-disable no-undef */
return typeof __channelId__ === 'string' && __channelId__
}
export function log (type) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key]
}
console[type].apply(console, args)
}
export default function formatLog () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key]
}
var type = args.shift()
if (isDebugMode()) {
if (isDebugMode()) {
args.push(args.pop().replace('at ', 'uni-app:///'))
return console[type]['apply'](console, args)
}
......
......@@ -34,7 +34,7 @@ const uniCloudPath = path.resolve(__dirname, '../../packages/uni-cloud/dist/inde
function getProvides () {
return {
'__f__': [path.resolve(__dirname, '../format-log.js'), 'default'],
'__f__': [path.resolve(__dirname, '../format-log.js'), 'log'],
'uniCloud': [uniCloudPath, 'default'],
'wx.nextTick': [runtimePath, 'nextTick'],
'Page': [runtimePath, 'Page'],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册