18 lines
359 B
JavaScript
Executable File
18 lines
359 B
JavaScript
Executable File
import { DEBUG } from './config.js';
|
|
|
|
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; |