Commit 64a04287e1ae8d581448bcb8dc29749fe139d0a7

Authored by vking
1 parent 7b4cf172

console 改为实时日志

Showing 1 changed file with 1 additions and 33 deletions
@@ -16,39 +16,7 @@ Array.prototype.remove = function(val) { @@ -16,39 +16,7 @@ Array.prototype.remove = function(val) {
16 this.splice(index, 1); 16 this.splice(index, 1);
17 } 17 }
18 }; 18 };
19 -if (wx.getRealtimeLogManager) {  
20 - const logger = wx.getRealtimeLogManager()  
21 - let consoleLog=console.log  
22 - function str2ab(str) {  
23 - var buf = new ArrayBuffer(str.length * 2); // 每个字符占用2个字节  
24 - var bufView = new Uint16Array(buf);  
25 - for (var i = 0, strLen = str.length; i < strLen; i++) {  
26 - bufView[i] = str.charCodeAt(i);  
27 - }  
28 - return buf;  
29 - }  
30 - function ab2str(buf) {  
31 - return String.fromCharCode.apply(null, new Uint16Array(buf));  
32 - }  
33 - function wlog(){  
34 - let argumentsX=[...arguments]  
35 - return new Promise(function (success,fail) {  
36 - let params=""  
37 - argumentsX.forEach((val,i)=>{  
38 - let str=JSON.stringify(val);  
39 - if(!str) return;  
40 - params+=str  
41 - })  
42 - let bs=str2ab(params.substr(0,1024*5))  
43 - logger.info(ab2str(bs.slice(0,1024*5)).toString());  
44 - success()  
45 - })  
46 - }  
47 - console.log=function () {  
48 - consoleLog(...arguments)  
49 - wlog(...arguments);  
50 - }  
51 -} 19 +import log from 'utils/realTimeLog'
52 App({ 20 App({
53 openid:"", 21 openid:"",
54 system:{}, 22 system:{},