Showing
1 changed file
with
2 additions
and
3 deletions
| @@ -23,10 +23,9 @@ Component({ | @@ -23,10 +23,9 @@ Component({ | ||
| 23 | top:(Math.random()*70+10) | 23 | top:(Math.random()*70+10) |
| 24 | }, | 24 | }, |
| 25 | ready: function() { | 25 | ready: function() { |
| 26 | - if(!console.hasRewrite){ | 26 | + if(!getApp().consoleHasRewrite && wx.getLogManager){ |
| 27 | const logger =wx.getLogManager() | 27 | const logger =wx.getLogManager() |
| 28 | - let consoleLog=console.log | ||
| 29 | - console.hasRewrite=true | 28 | + getApp().consoleHasRewrite=true |
| 30 | console.log.prototype=function(){ | 29 | console.log.prototype=function(){ |
| 31 | console.log(...arguments) | 30 | console.log(...arguments) |
| 32 | logger.debug(...arguments) | 31 | logger.debug(...arguments) |
-
Please register or login to post a comment