Update: 更新socket工作模式
This commit is contained in:
18
src/common/debug.js
Normal file
18
src/common/debug.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { DEBUG } from './config';
|
||||
|
||||
const Debug = {};
|
||||
|
||||
for (let key in console) {
|
||||
if (typeof console[key] !== 'function') {
|
||||
continue;
|
||||
}
|
||||
Debug[key] = (...args) => {
|
||||
if (DEBUG) {
|
||||
console[key](...args);
|
||||
} else {
|
||||
console.log(`[${key.toUpperCase()}]`, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Debug;
|
||||
Reference in New Issue
Block a user