初始化提交
This commit is contained in:
22
common/modules/mixly-modules/common/debug.js
Normal file
22
common/modules/mixly-modules/common/debug.js
Normal file
@@ -0,0 +1,22 @@
|
||||
goog.loadJs('common', () => {
|
||||
|
||||
goog.require('Mixly.Config');
|
||||
goog.provide('Mixly.Debug');
|
||||
|
||||
const { Config, Debug } = Mixly;
|
||||
const { SOFTWARE } = Config;
|
||||
|
||||
for (let key in console) {
|
||||
if (typeof console[key] !== 'function') {
|
||||
continue;
|
||||
}
|
||||
Debug[key] = (...args) => {
|
||||
if (!SOFTWARE.debug) {
|
||||
console.log(`[${key.toUpperCase()}]`, ...args);
|
||||
} else {
|
||||
console[key](...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user