27 lines
551 B
JavaScript
27 lines
551 B
JavaScript
const debug = {
|
|
log: function(...args) {
|
|
if (wx.getLogManager) {
|
|
const logManager = wx.getLogManager()
|
|
logManager.log(...args)
|
|
}
|
|
console.log(...args)
|
|
},
|
|
|
|
error: function(...args) {
|
|
if (wx.getLogManager) {
|
|
const logManager = wx.getLogManager()
|
|
logManager.error(...args)
|
|
}
|
|
console.error(...args)
|
|
},
|
|
|
|
warn: function(...args) {
|
|
if (wx.getLogManager) {
|
|
const logManager = wx.getLogManager()
|
|
logManager.warn(...args)
|
|
}
|
|
console.warn(...args)
|
|
}
|
|
}
|
|
|
|
module.exports = debug
|